Solved

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

  • 3 March 2022
  • 1 reply
  • 67 views

Badge +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!

icon

Best answer by sharif 7 March 2022, 17:26

View original

1 reply

Userlevel 5
Badge +9

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