fix(mobile): show premium modal on iOS

This commit is contained in:
Mo
2022-11-15 09:29:59 -06:00
parent d65abb9a49
commit e962e9c745
9 changed files with 69 additions and 31 deletions

View File

@@ -15,7 +15,11 @@ const NoSubscription: FunctionComponent<Props> = ({ application }) => {
const errorMessage = 'There was an error when attempting to redirect you to the subscription page.'
setIsLoadingPurchaseFlow(true)
try {
application.openPurchaseFlow()
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
} catch (e) {
setPurchaseFlowError(errorMessage)
} finally {

View File

@@ -15,7 +15,11 @@ const NoProSubscription: FunctionComponent<Props> = ({ application }) => {
const errorMessage = 'There was an error when attempting to redirect you to the subscription page.'
setIsLoadingPurchaseFlow(true)
try {
application.openPurchaseFlow()
if (application.isNativeIOS()) {
application.showPremiumModal()
} else {
application.openPurchaseFlow()
}
} catch (e) {
setPurchaseFlowError(errorMessage)
} finally {

View File

@@ -42,12 +42,20 @@ const HelpAndFeedback = ({ application }: { application: WebApplication }) => {
</a>
</Text>
{application.isNativeIOS() && (
<LinkButton
className="mt-3"
label="Privacy Policy"
link="https://standardnotes.com/privacy"
onClick={handleClick}
/>
<>
<LinkButton
className="mt-3"
label="Privacy Policy"
link="https://standardnotes.com/privacy"
onClick={handleClick}
/>
<LinkButton
className="mt-3"
label="Terms of Use"
link="https://www.apple.com/legal/internet-services/itunes/dev/stdeula/"
onClick={handleClick}
/>
</>
)}
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />