question

Robinmasque avatar image
Robinmasque asked

Marketplace not returned on Gen2 UserDataResponse?

Hi, we base our CurrencyCode and CultureInfo on the Marketplace that is returned in the UserDataResponse when we start up the IAP CPT Plugin on Unity. Things work correctly on Gen3+ devices: AmazonIapSdkCptServiceUnityAndroid: eventReceived: {"eventId":"getUserDataResponse","response":{"amazonUserData":{"marketplace":"US","userId":"9doPMRXk4ScQoyVtS38xUnwZT6YOv4jSSGj033EXpO0\u003d"},"requestId":"ab722208-6b1f-46e5-9bc8-27e23221e5bf","status":"SUCCESSFUL"}} But on Gen2 devices we get: AmazonIapSdkCptServiceUnityAndroid: eventReceived: {"eventId":"getUserDataResponse","response":{"amazonUserData":{"userId":"vfUOLW7-4-am11E9esBvsqcVg41hmxcdjrA4ZAXxZJU\u003d"},"requestId":"1fce6034-ceb8-4875-8177-7af619bebe65","status":"SUCCESSFUL"}} We're missing the Marketplace. Is this a known issue? How do we determine the Marketplace in this case? Thanks, J
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

justin avatar image
justin answered
Hi Robinmasque, You're using IAP V2, correct? Have you tried calling getMarketplace() directly on the response? [code]// ... private String currentUserId = null ; private String currentMarketplace = null ; // ... public void onUserDataResponse( final UserDataResponse response) { final UserDataResponse.RequestStatus status = response.getRequestStatus(); switch (status) { case SUCCESSFUL: currentUserId = response.getUserData().getUserId(); currentMarketplace = response.getUserData().getMarketplace(); break ; case FAILED: case NOT_SUPPORTED: // Fail gracefully. break ; } }[/code]
10 |5000

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