My problem:
I am having a hard time figuring out a way to safely manage auto-renewable subscriptions in iOS with Firebase.
Purchase process:
Edge cases causing my brain to implode:
Relevant articles I've been able to find:
How to tie auto-renewable subscriptions to in house user, not appled id
I've been struggling with this for sometime and haven't been able to find many resources. All help is appreciated.
2 iOS, an acronym for iPhone Operating System, is a Unix-derived operating system powering all of Apple's mobile devices. 3 The name iOS was not officially applied to the software until 2008, when Apple released the iPhone software development kit (SDK), enabling any app makers to create applications for the platform.
Device SelectioniOS is only available on Apple devices: the iPhone as a phone, the iPad as a tablet, and the iPod Touch as an MP3 player. These tend to be more expensive than equivalent hardware using Android.
The iOS is the operating system created by Apple Inc. for mobile devices. The iOS is used in many of the mobile devices for Apple such as iPhone, iPod, iPad etc.
Get the latest software updates from Apple The latest version of iOS is 16.0.3 for iPhone 8 and later. The latest version of iPadOS is 15.7. Learn how to update the software on your iPhone, iPad, or iPod touch.
For case #1:
When you attempt to access the receipt Apple will trigger a login prompt for the user to enter their iTunes credentials. If a receipt is still unavailable, you won't be able to verify the subscription status. The "right" way to do this is to store the entire receipt on your server, and periodically refresh it with /verifyReceipt
. You'll check if the subscription was cancelled, and update the expiration_date
so you know when to cut off access for the user.
For case #2:
Is it normal for me to handle this saying, "Apple Id already connected with another account or something"?
Yes! If you're able to look at how some other large subscription apps handle this (Netflix, Spotify, HBO, etc.) - it's similar to what you describe. Instead of checking the receipt locally every time, if you maintain the subscription status on your server (as mentioned in #1) this would only happen if the user tries to "Restore Purchases".
This is a pretty extreme edge case, since not many people try to make a purchase on their friends phone and would require TouchID/FaceID in most cases - so it's more of a fraud prevention feature. Once you get millions of users you can get fancy and send them an automated email link to signup with Stripe if you detect this.
Alternative:
RevenueCat can handle all the subscription tracking and these edge cases out-of-the-box, and it plays nice with Firebase. Disclaimer: I work there.
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