Question

WARN: ⚠️ allowSharingAppStoreAccount is set to false and restorePurchases has been called. Are you sure you want to do this?

  • 14 October 2022
  • 2 replies
  • 98 views

Badge +5

Im seeing this warning in the logs when I launch my app (iOS integration). I’m not calling Purchases.shared.restorePurchases() in this scenario (added a breakpoint to the line where it is called to verify it is not hit). I haven’t touched or set the allowSharingAppStoreAccount value anywhere so I’m not sure what this warning means, maybe I am doing something wrong with my RevenueCat integration? What could be causing this warning?

 

[Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

[Purchases] - DEBUG: ℹ️ CustomerInfo cache is stale, updating from network in foreground.

[Purchases] - DEBUG: ℹ️ Offerings cache is stale, updating caches

[Purchases] - DEBUG: ℹ️ GetCustomerInfoOperation: Started

[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/$RCAnonymousID%3A96F13EE4-CC53-4E78-A6A4-3BB161B05772

[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:96F13EE4-CC53-4E78-A6A4-3BB161B05772

[Purchases] - WARN: ⚠️ allowSharingAppStoreAccount is set to false and restorePurchases has been called. Are you sure you want to do this?

[Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: $RCAnonymousID:96F13EE4-CC53-4E78-A6A4-3BB161B05772

[Purchases] - DEBUG: ℹ️ Force refreshing the receipt to get latest transactions from Apple.

 

 


2 replies

Userlevel 3
Badge +5

Hey there. 

 

I jumped into the SDK code and it looks like we actually call this from syncPurchases (I know, bad naming). Can you see if you are calling syncPurchases anywhere?

Badge +5

@Jacob Eiting - thanks for taking a look.  I’m not calling syncPurchases anywhere in the code, it looks like it only happens the first time the app runs after upgrading to use RC so:

 

  1. Install our current app with no RC integration (note: apps are all on iOS)
  2. Install the updated version of the app with RC integration, open the app.

 

It looks like the default behaviour of the RC SDK is to create a new user in RC and upload all the receipt info without me adding any code to explicitly call restore or syncPurchase when the apps first runs, which seems like a good thing? I know you are not suppose to call restore without an explicit user interaction since it might pop up a sign in dialog, maybe internally the RC code is doing that the first time it is run somewhere? I’m still not sure if this warning is a problem or not?

 

Also I am confused about the syncPurchases method, it says we should call that on client migrations, but it seem like the RC SDK is automatically updating the server with the current receipt info on first run somehow without calling that method, so why do you ever need to call that?

 

Looking at this doc: https://www.revenuecat.com/v2.3/docs/user-ids it says that allowSharingAppStoreAccount will be set to false if you set your own App User ID, which is maybe why this warning is shown. I wonder if you could clarify this for me, basically we have existing users outside of RevenueCat, when a user installs the app we give them a userID, it’s basically equivalent to a revenuecat anon ID, where it’s only stored locally, if the user deletes/re-installs the app they get a new user ID.  The user can also install the app on multiple devices so an iPhone and also an iPad and get different user Ids, but should still be able to access the purchases on both devices.  So when porting to revenuecat it seems that only anonymous Ids will alias, if I set an explicit id like user1234 then purchases are transferred (seem right?) so you can’t share purchases across devices with different ids in that case, so I took my existing IDs and just prefixed them with $RCAnonymousID: e.g. I log into revenuecat as $RCAnonymousID:user1234 in the SDK, so in code I am calling:

configBuilder.with(appUserID: “$RCAnonymousID:user1234”)

Is that ok?

If I have existing user ids that are temporary (just stored locally) and want to be able to alias purchases across different devices using RevenueCat so user Bob on his iphone has user ID user1234 and on his iPad user5678 but both linked to the same iCloud account, is prefixing with $RCAnonymousID: ok, or if I just explicitly log into RC with our current user IDs e.g. configBuilder.with(appUserID: “user1234”), (on ipad) configBuilder.with(appUserID: “user5678”) how do I get user accounts to alias vs. transfer purchases?

Reply