Question

Subscription Promo Code still shows needs to be purchased at Paywall

  • 30 January 2024
  • 4 replies
  • 108 views

Badge +6

I have a paywall for monthly & annual subscription.  I want to give some partners a code to get the full annual subscription for free.  They said that when redeeming the code, with the full URL `https://apps.apple.com/redeem?ctx=offercodes&id=${apple_app_id}&code=${codeInput}` that they still see the paywall after loading the app for the first time.  I believe they have not downloaded the app even in this case, as they are new users.

I had them click Restore Purchase, but they claim that too does not work.

Is there a preferred method to get Promo Codes to work, on the first load of the application?  I tried reading the docs...i think i am all set, perhaps I need to have the listener?  But that doesn’t make sense if it’s a brand new user.


4 replies

Userlevel 4
Badge +6

Hey @lucksp!

 

Thanks for reaching out! 

 

Are you displaying the paywall by default or are you first checking if users have the entitlement before displaying the paywall? If these users have redeemed the promo code and already have the entitlement, then the paywall shouldn't show in this case. We recommend only showing the paywall if the user doesn't have the entitlement yet that is granted from the paywall. With this method, it might still show until the users restore purchases, but once they restore purchases than it should be hidden if the entitlement is granted. 

 

Let me know if that helps! 

Badge +6

I think I am pretty much doing that… I have a `Provider` wrapping my app to check purchase status and while that’s loading, I block the rest of the app.   Here is what is in the wrapper of the app:

const getInfo = useCallback(async () => {
try {
const info = await Purchases.getCustomerInfo();
packageRef.current =
info?.entitlements?.active?.[entitlementName]?.productIdentifier;

const { isActive } = info?.entitlements?.active?.[entitlementName] || {};
setIsActive(!!isActive); // state used by rest of app to determine if paid or free
if (isActive) {
setSawPaywall(true); // bypass the paywall on load
}
return info;
} catch (e) {
Bugsnag.notify({
name: 'getInfo Error in Purchase Provider',
message: (e as Error).message,
});
}
}, []);

useEffect(
function initPurchaseConfig() {
const initialize = async () => {
try {
if (__DEV__ && !paywallEligible) {
setIsReady(true);
setPurchasesChecked(true);
return;
}
Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG);
if (!APIKEY) {
throw new Error('Missing API Key for purchases');
}
await Purchases.configure({ apiKey: APIKEY });

getInfo(); // after configure, check entitlement
} catch (e) {
console.error((e as Error).message);
Bugsnag.notify({
name: 'initPurchaseConfig Error',
message: (e as Error).message,
});
setMessage(['error', (e as Error).message]);
} finally {
setIsReady(true);
setPurchasesChecked(true);
}
};

initialize();
},
[setMessage, setPurchasesChecked, getInfo]
);

The paywall get’s loaded because the Provider `isActive` state is false after checking.

Badge +6

We recommend only showing the paywall if the user doesn't have the entitlement yet that is granted from the paywall.

Out of curiosity, do you recommend a navigation route, or a conditional return from a component that blocks other things?

Userlevel 4
Badge +6

Hey @lucksp

 

We dont have a recommendation on how this is handled, but I personally would use a conditional return that would block this from other things in your case. 

Reply