My iOS app supports multiple user accounts, but the user can only be logged into one account at a time. The app also offers a subscription service ("credits" in the form of a renewable In-App Purchase).
I'm having trouble keeping the in-app subscriptions separated to the specific user account that bought them. If a user buys credits on Account One and then signs out, and another user signs into Account Two (on the same device), the SKPaymentQueue
still proceeds with the renewal process for the purchases from Account One (and, consequently, triggers the logic that unlocks those credits).
What is the correct method of handling renewable in-app purchases for an app that supports multiple accounts? Is there any way to keep purchases from "overflowing" into other accounts on the same device? What else should be kept in mind?
No. This is due to restrictions put in place by Google – core apps can be shared but in-app purchases cannot. For more information on Family Library and its features, please visit the link below.
You can share content that you purchase from Apple including music, movies, tv shows, apps, and books. You can also share your Apple subscriptions including Apple One.
In-App Purchase allows you to embed a store inside your app using the Store Kit framework. The framework connects to the AppStore on your app's behalf to securely process payments from users, prompting them to authorize payment.
I'm pretty sure what you're trying to do isn't possible. In-app purchases are tied to the Apple ID that purchased them. That means that if the user is logged into an Apple ID that has purchased the subscription, you are always going to be told it is available. A single user can't purchase the same subscription multiple times. The only way would be to force an Apple ID change when they change users in your app, which I'm almost certain you can't do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With