My problem:
I am having a hard time figuring out a way to safely manage auto-renewable subscriptions in iOS with Firebase.
Purchase process:
- User1 purchases a subscription
- Update User1's account on Firebase w/ the subscription identifier (used to unlock content)
- Store original_transaciton_identifier(OTI) w/ uid of User1 to match w/ receipt verification from Apple.
- Grant user access
Edge cases causing my brain to implode:
- User1 logs out of AppleId used to purchase subscription, but remains logged in to app w/ Firestore credentials.
- Therefore, when I go to verify if the subscription has expired it does not return a valid subscription. I want the user to be able to keep their access until it is expired or canceled. Any tips on achieving this?
- User2 logs into the same device User1 was previously using.
- Therefore, the same AppleId is being used for both users. I can check if the current user has a subscription, and check the OTI to see if it corresponds to User2...which it won't.
- We will show the 'purchase iAPs' screen, but what if this user wants to buy a subscription as well under the same AppleId? Is it normal for me to handle this saying, "Apple Id already connected with another account or something"?
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.