Testing iOS subscriptions upgrade/downgrade on sandbox - ios

At the moment, we have one auto-renewable subscription on our live app, and we want to add two more, where the only difference is the price and the subscription time. To accomplish that, we created a "subscription group" and everything is set up on the apple side:
and the app is currently reading all the packs from the store and allow the user to buy them.
Our issue is that we can't fully test the upgrade/downgrade feature when trying to buy another subscription level on sandbox (iOS 14.5). If we buy the lowest pack first, and then try to buy a superior pack, a popup should appear saying that we want to modify our current subscription plan to another one and that it will start on XX/XX/2021 as seen here (image from a tutorial):
This is not the behaviour we are seeing on our app (on sandbox). When we try to buy a superior plan the app shows the normal purchase popup:
and it proceeds to buy the pack normally without showing the popup warning that we are changing our current plan.
This causes some concerns, as it implies that the user is buying two subscriptions. They are on the same subscription group, so it should be impossible, but still brings concerns... Did anyone experienced the same issue? Is this the normal behaviour in sandbox?

Related

Auto restore/sync in-app purchases in Newsstand app prior to iOS 9 and iTunes password prompt issue

I have recently started developing Newsstand application and need to deal with the restoration of in-app purchases. There are cases resported that some users made unwanted "duplicated" purchase in the following situation:
There are two kinds of purchases in the app:
1. One year subscription which will allow users to have access to all magazines issued within the subscription period
2. Single specific issue purchase, which will allow users to buy specific issue they would like to access to
And the problem arises when:
User made an one year subscription
User install the Newsstand app on another device/re-stall after deleting the app
User purchase single issue which should be included in the subscription
In step 3, the user should have "owned" the issue he wanted to purchase and the purchase option for that specific issue will not be available, but since he/she didn't perform a restore, the app does not know the user has an active subscription which includes the targeted issue, as a result the user is charged for the specific issue while he/she should not be.
To deal with this, I am thinking of prompting the user to perform a restore upon first launch of the app after installation, but there are a few questions I would like to clearify and couldn't find any reference or documentation:
I was told that prior to iOS 9, the Newsstand app (the one which will have all contents of newsstand applications' contents showed up as a bookshelf) could auto sync/restore purchased contents of the iTunes account logged-in on the device, i.e. after installation and launch the app, the user will have all of his previous purchase there without manually performing a restore. Is this real and is there any documentation regarding this? Or is this related to certain settings related to AppStore's auto-download, etc? This is reported by one of the user and he claimed that he is very sure that he got all the contents without manually restoration after installing the app as he tested this on his iOS 8 device. I ran out of luck in finding and proofing this as I do not have any physical device with iOS 8 or before, and the simulator does not support purchase related API.
When performing restoration, under what circumstances the user will be prompted for password input? As sometimes I would proceed to restoration directly without password input, is this related to time passed since last password input?
Thanks!

Testing IAP edge cases in iOS (eg: missing credit card info, etc.)

We currently have an app in the app store that uses IAP to disable ads and add a few features.
However, we've noticed that some users have problems buying the IAP. After scrutiny it seems most of it comes down to not having an active internet connection on the moment of purchase. About a dozen cases however could not be tracked down and resolved.
One of these:
tap buy IAP
Credit Card security code was not yet filled in
purchase fails
user is automatically moved to his App Store account to fill in the missing code
user fills in code and confirms buying the IAP
user goes back to the app
purchase is still failed (!)
Conclusion: user paid and did not yet receive the IAP.
(of course this can be resolved by tapping the IAP again and downloading for free, but that's not ideal)
We're looking to test a solution to such edge cases.
However test accounts usually do not require valid CC info. Thus..
Question: How do I test such cases?
I have been using prepaid credit cards to test and make sure it goes through.

How do I do a "combined" subscription model in iOS app?

We have a print magazine and we're going to release an app with subscription model, sort of kiosk app but with extended functionality.
Well, what we want is to solve the following cases:
Case 1 (complex)
User buys a print issue and discovers a promo code in it. This code should allow user to download free digital copy of this issue from our app.
User launches the app, opens a dialog box where he can enter the promo code.
Voila! User gets his free digital copy of purchased print issue.
Digital issue always remains in his list of purchased issues and is a valid purchased issue with all App Store options available for them (restore, etc.)
Case 2 (simple)
User does not have a print issue. He launches the app and buys the same digital issue using IAP.
So, both issues are the same (i.e. "blablabla magazine", November, 2014) but 1st was downloaded using a promo code, and 2nd was purchased with IAP, and they both should have the same properties and "weight" for App Store.
Problem is I don't know if this model will be approved by Apple. Or, if they do, how do I develop this? AFAIK, list of purchased and non-purchased items is provided by App Store and there's no way to intervene this process.
I didn't find any samples of using 3d party promo codes in iOS apps. Can anyone provide a solution for this, please?
Thanks
To keep a record of the promo code usage, I think the simpliest way to do it is to require an account. Once the user is logged with his account, you can tell a server that the promo code have been used with that account. If the user delete/reinstall your app, you will be able to restore all his promo codes from his account.
For your issue with IAP and promo codes, here is the App Store Review Guidelines
See the 11.16 section:
Apps may enable additional approved features or functionality when
used in combination with specific approved physical products (such as
a toy) as long as the additional features and functionality are either
completely dependent on such hardware (for example an App that is used
to control a telescope) or also available through the App without the
physical products, such as by way of reward for achievement or by use
of IAP
So basically, what you want to do shouldn't be rejected.
But by experience when you do something that borderline with Apple's money (possibility to "undercut" IAP), you should expect a review failure, whatever the guidelines review says.
Keep in mind that the guidelines can be interpreted in your advantage, or in you disadvantage.

Is it possible to detect when a user has re-purchased a non-consumable IAP for free?

When a user of an iOS app purchases a non-consumable item, then installs that app on a new device, it is possible for them to again go through the standard purchasing logic for that item. The app store will ask them if they wish to spend $0.99 on the item, but if they click "Yes", it will inform that they already own that item, and ask if they wish to download it for free.
I would like to track new purchases in my analytics, and not have them conflated with re-purchased items that a user receives for free. Unfortunately, it seems that this behavior is indistinguishable from a genuinely new purchase, (to the client app). Apple seems to say as much: "Note: If the user attempts to purchase a product that’s already been purchased, rather than using your app’s restoration interface, the App Store creates a regular transaction instead of a restore transaction. The user isn’t charged again for the product. Treat these transactions the exact same way you treated the original transactions."
In discussing this issue, most posts (and Apple's documentation) say that I should offer a 'Restore Transactions' button to the users. I do offer this button, but it is always possible for users to circumvent this logic, and go through the traditional purchasing route. This is where my tracking will become inaccurate.
Do I have any options? Thanks!
I am pretty sure you don't have any options for tracking a new purchase versus downloading a previous purchase for free when a user does an in app purchase. I have looked into this for the same reason of analytics and I could not find a way to do it. IAP is set up to make sure that you honor purchases made by the same iTunes account on other devices.
If your users are required to have an account specific to your app to make a purchase you could use that to know if they already have made the purchase or not. But requiring an account for purchase can lower your conversion rate.

How to 'fake' a restore in-app purchase for previous app users when moving from paid to free

Our app is moving from paid to free, and in the process, moving a key functionality from being included to activating via In-App purchase. Obviously, we don't want current users who paid for the app functionality to be charged again in the In-App purchase for functionality they already had. So on the update by the user, we want to 1) identify current users and 2) make it so they don't see the In-App purchase in the first place, sort of 'faking' the In-App purchase so that the app will appear to them exactly as it did before.
The app does not have a backend, so we have to determine current users from new by examining the saved user data fields for certain values. I do understand that if a previous user has deleted the app from their device that nothing can be done, and I don't mind charging them for the In-App purchase, since they never used the app anyway.
But for those current users who update and assuming we can examine the saved user data and determine that they are current users, what would be a good way to bypass the In-App purchase and make the app look like they already got it, when in fact they never paid for it? Thanks!
Here's what I would do - keep in mind this will take some time:
Set up a server (I prefer EC2) with mySQL on it. Plenty of tutorials about this.
Submit an update to your app that sends the user's UUID to your server.
Wait. This is the hardest part. You'll need to wait until satisfactory majority has updated to your app. That majority percentage is up to you to figure out. It could take months for this to happen.
Make your new, free, app send the UUID to the server.
Check to see if the UUID is in the DB.
If it is, set whatever you would have set when an in-app purchase was made to true.
You have several options:
Free in-app purchase for a limited time:
You would create a free tier in-app purchase content and release an update that somehow makes the user sign up for it. This way, when your user switches devices they can restore the purchase and regain the functionality.
Wait for a period so most people use the in-app purchase content
Change the tiers and release your app as free
Dual versions
Make a demo version of your app. Note this can be rejected by Apple.
Create a file in the filesystem
Make a file in the filesystem and save into iCloud. The app will check for the file and thats how you would determine if the user has paid for the app (or should buy the in-app purchase).
iCloud will synchronise the file between user's devices and it will make sure that whatever device the user uses the app will see the user as 'paid'.
I hope this helps, currently having this problem myself.

Resources