Hi! I have a Flutter app using RevenueCat for subscriptions.
When a user activates a promo code via the App Store (outside the app), RevenueCat sends a webhook with an anonymous app_user_id
(e.g., RCAnonymousID:abc123
).
The problem is that my backend expects a known user_id
to associate the subscription with a user. Since the user hasn’t logged in yet, there’s no way to identify them based on this anonymous ID, and the webhook ends up being ignored.
Later, when the user logs in to the app, I call:
await Purchases.logIn(customUserId);
But by that time, the webhook has already been processed (or missed), and there’s no connection between the anonymous ID and the logged-in user.
What I want:
-
To be able to process the first webhook, even if the subscription was activated anonymously (via promo code).
My questions:
-
What is the correct way to associate an anonymous RevenueCat ID with a custom user ID?
-
How can I reliably process the first webhook and link it to the right user?
-
Is there a way to track or reprocess such webhooks after login?
Thanks a lot for your help!