Skip to main content

How do I know the customer id (originalAppUserId) when a notification is sent to my server?

When a user purchases a consumible item I can see the userId in the dashboard, but can’t see it in the callback to my server URL. I only get this information:
/'appAppleId', 'bundleId', 'bundleVersion', 'environment', 'signedTransactionInfo']

 

In the signedTransactionInfo I get this keys:
transactionId, originalTransactionId, bundleId, productId, purchaseDate, originalPurchaseDate, quantity, type, inAppOwnershipType, signedDate, environment, transactionReason, storefront, storefrontId, price, currency]

None of them are related to the user, so how can I know what user made the purchases being notified to my server?

Hopefully somebody can help me out with this.

Thanks in advance :)

I resolved this by login in the user with an id with:

const { customerInfo, created } = await Purchases.logIn(userId);



When you do that before buying, the response after “type” key will now have “appAccountToken”, and there it is the userId 😀