question

anastasia-spb avatar image
anastasia-spb asked

Different user ids in in-app purchasing workflow. Proper way to handle.

Hello. Please help me to understand in-app purchasing life cycle. Lets talk in terms of BasePurchasingObserver. In onGetUserIdResponse(GetUserIdResponse userIdResponse) we get an user id. It is unique for the application, right? But we also can get in onPurchaseUpdatesResponse(PurchaseUpdatesResponse purchaseUpdatesResponse) an object with a different user id, I mean purchaseUpdatesResponse.getUserId() is not equal to the previously obtained value. Could you please explain how this case can be possible. What is right way to handle it?
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi, Thank you for writing to us. Both ids are same and point to the same user (account that is used to register the device) for the same app (the package). So for the same user account and same app, the same user id would be returned across all the devices. onGetUserIdResponse provides access to the app-specific ID of the currently logged in user. onPurchaseUpdatesResponse returns the ID of the user associated with the updates. Theoretically both are same.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.