Skip to main content
Question

User alias is created with delay


Forum|alt.badge.img+1

Hello,

We have started using Revenue Cat to manage in-app purchases, but we are having trouble recovering purchases that were not made via RevenueCat on Android. We login the user via SDK using Purchases.sharedInstance.logInWith("our-custom-user-id"). We wait for a successful response and if the user is logged in for the first time, we call Purchases.sharedInstance.syncPurchases() to sync the purchases not made via RevenueCat. The problem is the "timeline" of events. See screenshot.

The webhook for the purchase was sent with an anonymous user ID because an alias was not created at the time. We are unable to sync purchases on our backend with an anonymous user id. Since the "SUBSCRIBER_ALIAS" webhook is deprecated, we are unable to wait for this webhook and sync purchases after that. Please help. Do you have any solution for this?

Thank you in advance for your reply.

5 replies

Forum|alt.badge.img+1
  • New Member
  • 3 replies
  • July 20, 2023

Is there anyone from RevenueCat to explain on this? We have encountered the exactly same problem, and it has caused some loss already. 


Forum|alt.badge.img

same here


Forum|alt.badge.img+2
  • Member
  • 8 replies
  • March 9, 2025

same problem,i am losing customers and increasing refund rate due to issue, user cannot be premium on webhook


kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 365 replies
  • March 11, 2025

Hey team,

Part of the reason we don't send this event anymore is that the anonymous ID still refers to the same user even if the user was aliased with a new (identified) user ID. So, you can take the anonymous ID and fetch customerInfo from the SDK or API, and it will return the same information for both IDs (as they are treated as one in RevenueCat).
 
If you're trying to track all IDs on your end, there are a couple of options here. First, whenever you receive a new webhook with the latest user ID (a new purchase or subscription event), you could update the IDs in your database, as all aliased IDs will be available in the event under the aliases key. Or, if this won't work for your use case, whenever you call login in your app, you could notify your backend to fetch the latest customerInfo from our API and update the IDs accordingly.

A bit more info in our documentation here: https://www.revenuecat.com/docs/customers/identifying-customers#aliases


Forum|alt.badge.img+2
  • Member
  • 8 replies
  • March 11, 2025

i have solved my problem by configure revenue cat with appUserID not just app key 

here check for swift ui

 

if let userID = KeychainHelper.shared.retrieve(forKey: UserManager.shared.userIDKey) {

               // Configure RevenueCat with the user ID

               Purchases.configure(

                   withAPIKey: "apikey",

                   appUserID: userID

               )

               print("Configured RevenueCat with existing userID from keychain")

               

//               // Since we're already configuring with the userID, we can optionally track this

//               FirebaseManager.shared.logEvent(name: "revenue_cat_auto_login", parameters: [

//                   AnalyticsParameter.userID: userID

//               ])

           } else {

               // No userID found, configure RevenueCat without user ID

               Purchases.configure(withAPIKey: "apices")

               print("No userID found in Keychain, configured RevenueCat without user ID")

           }

           


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