RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
770 stars 84 forks source link

Modify Confrim Purchase Popup for iOS #135

Closed yaronlevi closed 4 years ago

yaronlevi commented 4 years ago

Hi (-:

I hope you are well at these times.

We have completed the integration of the RN SDK. To test the flow "end to end", we've created and an in-app purchase sandbox account (as described in the docs).

We start the flow by calling the code:

const { current } = await Purchases.getOfferings();
const package = current.availablePackages[0];
await Purchases.purchasePackage(pack);

After calling the code above, a popup is shown to enter the email and password for an account. I then entered the email and password of the sandbox account. Now the following popup is shown:

IMG_20200402_200109

This is a generic system popup and is quite different from the popups I've seen in other apps. For example, in the Medium app:

WhatsApp Image 2020-04-02 at 18 05 28

I've seen this exact popup in other iOS apps.

My question is how can I make it so that RevenueCat SDK will show this popup and not the simple one? Is the simple popup shown because I am using a sandbox account? Can I control some aspects of this popup via the SDK?

aboedo commented 4 years ago

Hi! This is normal, it's always shown when you're in sandbox. Once your app is in production, you'll see the regular prompt. This is strictly iOS-specific and not related to RevenueCat. When in Sandbox, you also don't get the chance to use TouchID or FaceID to authorize the purchase, which you do with the production version of this prompt.

aboedo commented 4 years ago

for more info, check out our iOS purchase testing guide:

https://github.com/RevenueCat/iOS-Subscription-Testing/blob/master/basics/testflight.md#testflight-testing

It mentions this behavior:

Unfortunately, the production sandbox purchase process does not mimic the App Store purchase flow, which makes it confusing for beta testers. (Apple briefly enabled an App Store-like payment flow but quickly reverted it. Here’s hoping it comes back someday!)

aboedo commented 4 years ago

As for whether you can modify any aspects of the prompt, I'm afraid not. It's managed exclusively by iOS, and not accessible to apps. I believe this is for security purposes, so that apps can't abuse the UI to trick users into purchasing. It also makes the UI standard and the pricing and terms clear and easy to read.

I'm closing this issue since there's not much to do here, but feel free to contact us with any other questions!

yaronlevi commented 4 years ago

Thank you for the detailed answer!