Hi everyone! I’m new here and still learning, so please be patient if I say something silly 😅
I’m using Expo Go (React Native) in my app, and I’m implementing RevenueCat.
I’m currently using the Test Store to simulate subscriptions.
In my case, users can upgrade or downgrade between plans.
The only difference between the plans is the cloud storage limit, which is controlled by the active product_id.
In my app, users can only have one active subscription at a time.
Current setup in RevenueCat
Offerings
-
Created one offering called
default
Packages
-
Inside this offering, I created “Custom” packages since all of my plans are monthly
(the package only allows one monthly product per offering, so I used “Custom”)
Products
-
I have subscriptions imported from Google Play
-
And test subscriptions configured in the Test Store with similar
product_ids
Entitlements
-
I have only one entitlement called
storage_access
In my Expo app
I list all the packages from the current offering and let the user pick one to subscribe to.
Then, I check if the user already has an active subscription, and if so, I try to perform an upgrade/downgrade using this code:
const ci = await Purchases.getCustomerInfo();
const currentEntitlement = ci.activeSubscriptions[0];
const googleProductChangeInfo = {
oldProductIdentifier: currentEntitlement,
prorationMode: Purchases.PRORATION_MODE.IMMEDIATE_AND_CHARGE_FULL_PRICE,
};
const { customerInfo } = await Purchases.purchasePackage(
selectedPlan,
null,
googleProductChangeInfo
);
const entitlement = customerInfo.entitlements.active["storage_access"];
But I get this error:
[RevenueCat] 🤖‼️ PurchasesError(code=PurchaseNotAllowedError, underlyingErrorMessage=No active purchase found for product: lite, message='The device or user is not allowed to make the purchase.')
My questions
-
What am I doing wrong in this flow?
-
Will this same flow work for iOS in the future?
-
Is my product/offering/package structure set up correctly?
If anyone has experienced this with the Test Store or knows a better way to structure upgrade/downgrade flows, I’d really appreciate your help
