question

Surver avatar image
Surver asked

Can javascript IAP handle multiple users on 1 Amazon account?

Background: Dad & Kid both play my webapp game on the 1 device via different usernames (each plays different Levels & has different scores which are tracked & stored individually). But then Dad wants to purchase Level 3 games so he logs into his Amazon account & buys Level 3 games - and the webapp game records this purchase to Dad's username. Question: Can Kid also purchase Level 3 games using Dad's Amazon account (the webapp game would record any purchase to Kid's username) or will Kid get an "Already_Entitled" message ? In other words, does Kid also need a separate Amazon account to purchase Level 3 games ?
web apps
10 |5000

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

Surver avatar image
Surver answered
a response would be much appreciated.
10 |5000

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

Surver avatar image
Surver answered
I also notice that in the test environment (SDK Tester & Amazon Web App Tester) the response to this call: amzn_wa.IAP.getUserId() returns a different 36 character UserId even though the User in the SDK Tester hasn't changed. I assume in the real world app this UserId returns one consistent Id for the currently logged-in Amazon user - is that correct ? A prompt response to my now 2 questions would be much appreciated.
10 |5000

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

Surver avatar image
Surver answered
Ok - I've answered my own questions - response documented here in case it helps others. My main mistake was that I didn't call amzn_wa.IAP.getUserId() from WITHIN amzn_wa.IAP.registerObserver({ }) even though the registerObserver had already initialised onLoad. As soon as I had this (abbrev version): amzn_wa.IAP.registerObserver({ amzn_wa.IAP.getUserId(); }) then it returned the userId set in the SDK - e.g. "dad" or "kid". Once I got the userId correctly returned, it was easy to see that kid had access to Levels purchased under dad's Amazon account.
10 |5000

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