Skip to main content
Solved

Will calling the Flutter SDK's `setup` with a user ID alias it with the anonymous ID?

  • 3 March 2022
  • 1 reply
  • 76 views

Forum|alt.badge.img+1

Currently, the paywall in our app is only shown to users who are logged in, so we do not need to deal with anonymous users.

 

However, we are introducing Apple offer codes and we want to support the URLs with the offer code embedded. I am hoping this flow will work:
 

  1. User clicks on the URL with the Apple offer code embedded
  2. User redeems the code
  3. User downloads our app and registers with us, we create a user ID for them
  4. We call setup from the Flutter SDK with the user ID

At this point, if we make a call to GET /subscribers/app_user_id with the new user ID, will it return the entitlement that was granted using the offer code? Will setup have aliased the anonymous ID with our new user ID?

 

Thank you very much for your help!

Best answer by sharif

That would work, although it’s recommended to call setup as soon as the app launches. This is because setup sets up the payment queue to get notifications from Apple about offer codes, promo codes, etc. and Apple recommends to set up the queue as soon as the app launches. Calling setup before the user logs in will result in anonymous aliases on users, but this hopefully shouldn’t cause issues since all aliases are sent in webhooks and you can use any alias with our API.

View original

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • March 7, 2022

That would work, although it’s recommended to call setup as soon as the app launches. This is because setup sets up the payment queue to get notifications from Apple about offer codes, promo codes, etc. and Apple recommends to set up the queue as soon as the app launches. Calling setup before the user logs in will result in anonymous aliases on users, but this hopefully shouldn’t cause issues since all aliases are sent in webhooks and you can use any alias with our API.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings