Initialize RevenueCat STORE for both iOS & Android in a single Screen
Suggesting a way to --> Initialize RevenueCat STORE for both iOS & Android in a single Screen
If you are controlling both Android and iOS paywall screen from a single screen, then initialize RevenueCat STORE like below just before calling product purchase API instead of calling the initialize SDK inside useEffect().
It was not very clear in the documentation that how it could be done very fast.
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
and how to handle slow test card , Approves after some time case as it goes in the error block
const productToBuy = {
identifier: selectedPlan.identifier,
description: selectedPlan.description,
title: selectedPlan.title,
price: selectedPlan.price,
priceString: selectedPlan.priceString,
currencyCode: selectedPlan.currencyCode,
introPrice: selectedPlan.introPrice,
discounts: selectedPlan.discounts,
productCategory: selectedPlan.productCategory,
subscriptionPeriod: selectedPlan.subscriptionPeriod,
defaultOption: selectedPlan.defaultOption || null,
subscriptionOptions: selectedPlan.subscriptionOptions || null,
presentedOfferingIdentifier: selectedPlan.presentedOfferingIdentifier || null,
};
const { customerInfo, productIdentifier } = await Purchases.purchaseStoreProduct(
productToBuy
);
****Goes in the error block and gives if slow test card [Error: Payment is Pending]****
Alert.alert('Success', 'Plan Purchased successfully');
navigation.goBack();
```}
Hey @anisurrahman072 !
Thanks for the feedback, I have noted this and we will work on updating the documentation to make this clearer.
@michaelAtRC can you help me if you how to handle slow test card scenario for google console sandbox environment ?
Hey @mangal-brovitech ,
That is usually a case of the sandbox user having a long history of purchases. I recommend testing with a fresh sandbox user and testing this function again.
Let me know if that helps!