Question

How do I pull active subscriptions on device? iOS

  • 21 April 2023
  • 4 replies
  • 36 views

Badge +3

My app has a multi-user login system. I’m offering ability to purchase individual subscriptions based on account.

 

I need a way to pull current active device subscriptions so I can assign unique subscriptions to user accounts.

 

Does revenue cat have a Swift SDK option to pull current active device subscriptions?


4 replies

Badge +3

Additionally, in my app, when a user logs out and logs back in as a different user, the subscription gets transferred from the original subscribing user to the new account that logged in.

Userlevel 4
Badge +6

Hey @patrick-1314a4 ,

 

Do you want help with migrating subscriptions over to RevenueCat? If so, you could perform a client-side migration to get those users with old subscriptions over to RevenueCat. 

 

Additionally, in my app, when a user logs out and logs back in as a different user, the subscription gets transferred from the original subscribing user to the new account that logged in.

This is because the user id and the subscriptions are being transferred over to the new user. I recommend reading more about the logIn() method functionalities and how we handle switching accounts here. If you need to switch from one provided App User ID to another, it's okay to call the .logIn() method directly - you do not need to call logOut() first. We suggest this because calling logOut() will generate a new anonymous App User ID for the logged out state which could contribute to the confusion and aliasing of ID’s. 

 

I hope this helps! 

Badge +3

Thank you @Michael Fogel 

 

This is my first implementation of subscriptions in my app, so I’m not transferring any older subscriptions.

 

I think my issue here is that I’m attempting to maintain multiple duplicates of the “same” subscription across multiple sub-accounts in my app.

 

I am unable to pull /all/ active subscriptions within the users Apple ID, so I don’t have clarity within my app on which subscription to apply when a user applies for multiple subscriptions.

 

I may consider reworking my subscription model to handle a single subscription per Apple ID that gets applied to all logged in user accounts.

Userlevel 4
Badge +6

If your apps are all in the same project, then the subscriptions will be stared across the different apps in that project. For example if you have a suite of productivity apps on iOS that share a common subscription you can add them under the same Project in RevenueCat. However, if you have multiple iOS apps that all function independently and don't plan to have a shared subscription you should add them each under different Projects. If they are all in the same project, the same entitlements will be spread across the apps and the same app user ID’s so the users will be able to access their subscription across all of these different apps! 

 

Hope that helps! 

Reply