Skip to main content

Hello, my user flow is like this:
- user purchases subscription (not logging in with Purchases.logIn() )→ Revenuecat generates an anonymous id → INITIAL_PURCHASE event is triggered

​​​- after purchase: the user logs in with Firebase auth (logging in with Purchases.logIn() after account creation) → No event trigger

I’m grating users credits on INITIAL_PURCHASE. My issue is now that there is no event triggered when logging in with custom app user id. I don’t have any reference to between the anonymous id and custom user id. 

Is there any way to get aliases with the custom user id as a query from the backend, or am I missing something?

Hey There,

 

One thing that you can do is with your current workflow, after the purchase happens and the users logs in, you call syncPurchases or have the restore purchase. This should create a transfer event which will help link that purchase to the new logged in app user ID. The event that woudl be generated by this would be a TRANSFER event. TRANSFER events happen when a transfer of transactions and entitlements was initiated between one App User ID(s) to another. Please note: The webhook will only be sent for the destination user despite us displaying this event in both customer histories because the event body is exactly the same for both users.  

 

Calling login will not generate an event, so another good workaround for this will be changing your flow to make the purchase after configuring the SDK with the specific ID or after logging in. That way the purchase will be linked to the proper account from the beginning and you wouldnt need to restore or syncPurchases.


Reply