Skip to main content
Question

How to know the customer id from the forwarding URL

  • September 18, 2024
  • 1 reply
  • 36 views

Forum|alt.badge.img+2

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 :)

This post has been closed for comments

1 reply

Forum|alt.badge.img+2
  • Author
  • New Member
  • 4 replies
  • September 19, 2024

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 😀


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