question

Csaba Toth avatar image
Csaba Toth asked

Unity Game's IAP works in sandbox mode, but not in real life

I'm trying to enable Amazon IAP for a Unity game. Currently Unity plugin is only available for IAP v1.0. The purchase works fine with the SDK tester, but when I try it on the released game (I don't have an Kindle Fire or such, but I install the game using the Amazon Store app onto my Android phone) it fails. What I can tell from my debug log is that my SKU looks OK. However I see this: I/AmazonAppstore.BackoffRetryHandler(26295): Got a retry request I/AmazonAppstore.BackoffRetryHandler(26295): Not retrying client error: 400 I/AmazonAppstore.BackoffRetryHandler(26295): Retrying request? false E/AmazonAppstore.IAPErrorTypeInterceptor(26295): Received a service error in response: status code=400, message=1 validation error detected: Value '[]' at 'vend orSkuList' failed to satisfy constraint: Member must satisfy constraint: [Member must have length greater than or equal to 1] E/AmazonAppstore.IAPErrorTypeInterceptor(26295): com.amazon.iap.client.exception.ServiceException: 1 validation error detected: Value '[]' at 'vendorSkuList' fa iled to satisfy constraint: Member must satisfy constraint: [Member must have length greater than or equal to 1] E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.interceptor.IAPErrorTypeInterceptor.after(IAPErrorTypeInterceptor.java:71) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.util.Web.after(Web.java:295) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.util.Web.execute(Web.java:317) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.IAPClient.request(IAPClient.java:442) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.IAPClient.getProductsByVendorSku(IAPClient.java:328) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl$GetProductsByVendorSku.getItems(CatalogManagerIm pl.java:129) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:103) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:52) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.command.purchaseitem.PurchaseItemAction.executeRequest(PurchaseItemAction.j ava:122) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.command.purchaseitem.PurchaseItemAction.executeRequest(PurchaseItemAction.j ava:51) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.command.IapCommandAction.execute(IapCommandAction.java:57) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.action.CommandActionChain.execute(CommandActionChain.java:31) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.action.CommandActionChain.execute(CommandActionChain.java:31) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.action.CommandActionChain.execute(CommandActionChain.java:31) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.action.CommandActionChain.execute(CommandActionChain.java:31) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.action.CommandActionExecutor.execute(CommandActionExecutor.java:35) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.CommandServiceStub.execute(CommandServiceStub.java:67) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.venezia.command.CommandService$Stub.onTransact(CommandService.java:56) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at android.os.Binder.execTransact(Binder.java:404) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at dalvik.system.NativeStart.run(Native Method) E/AmazonAppstore.IAP/PurchaseItemAction(26295): Error verifying purchase request sku : So it seems that the guts of the IAP plugin sees an empty SKU. Maybe I leave out some initialization phase? The game originally used Prime31 for Google and iOS IAP. Prime31 doesn't support Amazon, so I commented out some code. During initialization phase I call: AmazonIAP.initiateItemDataRequest (new string[] { "One_of_the_SKUs" }); I don't query the inventory though, since I know the inventory and SKUs without querying it. Maybe that's the problem? Or I need to do some other initialization? Any help is appreciated.
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.

Csaba Toth avatar image
Csaba Toth answered
I think the error will come from the Unity part of my application. I have the right SKU, but when the Amazon API is called, I believe the SKU string supplied is empty string, and that causes the error. The Unity project uses Prime31, which doesn't support Amazon IAP, and maybe the presence of that creates such a hybrid situation that causes this error. It's a headache.
10 |5000

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

Csaba Toth avatar image
Csaba Toth answered
I double checked everything in my application. I still deal with this: E/AmazonAppstore.IAPErrorTypeInterceptor(26295): Received a service error in response: status code=400, message=1 validation error detected: Value '[]' at 'vend orSkuList' failed to satisfy constraint: Member must satisfy constraint: [Member must have length greater than or equal to 1] E/AmazonAppstore.IAPErrorTypeInterceptor(26295): com.amazon.iap.client.exception.ServiceException: 1 validation error detected: Value '[]' at 'vendorSkuList' fa iled to satisfy constraint: Member must satisfy constraint: [Member must have length greater than or equal to 1] E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.interceptor.IAPErrorTypeInterceptor.after(IAPErrorTypeInterceptor.java:71) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.util.Web.after(Web.java:295) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.client.util.Web.execute(Web.java:317) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.IAPClient.request(IAPClient.java:442) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.iap.IAPClient.getProductsByVendorSku(IAPClient.java:328) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl$GetProductsByVendorSku.getItems(CatalogManagerIm pl.java:129) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:103) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:52) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.purchase.AbstractPurchaseFragment$PurchaseInitiateMetric.doInBackground(Abs tractPurchaseFragment.java:598) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at com.amazon.mas.client.iap.purchase.AbstractPurchaseFragment$PurchaseInitiateMetric.doInBackground(Abs tractPurchaseFragment.java:593) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at android.os.AsyncTask$2.call(AsyncTask.java:288) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at java.util.concurrent.FutureTask.run(FutureTask.java:237) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AmazonAppstore.IAPErrorTypeInterceptor(26295): at java.lang.Thread.run(Thread.java:841) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): Error determining item type when creating detail page E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): com.amazon.mas.client.iap.catalog.CatalogRequestException: com.amazon.iap.client.exception.ServiceExceptio n: 1 validation error detected: Value '[]' at 'vendorSkuList' failed to satisfy constraint: Member must satisfy constraint: [Member must have length greater tha n or equal to 1] E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:105) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:52) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.purchase.AbstractPurchaseFragment$PurchaseInitiateMetric.doInBackground(Abs tractPurchaseFragment.java:598) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.purchase.AbstractPurchaseFragment$PurchaseInitiateMetric.doInBackground(Abs tractPurchaseFragment.java:593) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at android.os.AsyncTask$2.call(AsyncTask.java:288) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at java.util.concurrent.FutureTask.run(FutureTask.java:237) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at java.lang.Thread.run(Thread.java:841) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): Caused by: com.amazon.iap.client.exception.ServiceException: 1 validation error detected: Value '[]' at 'v endorSkuList' failed to satisfy constraint: Member must satisfy constraint: [Member must have length greater than or equal to 1] E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.iap.client.interceptor.IAPErrorTypeInterceptor.after(IAPErrorTypeInterceptor.java:71) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.iap.client.util.Web.after(Web.java:295) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.iap.client.util.Web.execute(Web.java:317) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.iap.IAPClient.request(IAPClient.java:442) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.iap.IAPClient.getProductsByVendorSku(IAPClient.java:328) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl$GetProductsByVendorSku.getItems(CatalogManagerIm pl.java:129) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): at com.amazon.mas.client.iap.catalog.CatalogManagerImpl.getItems(CatalogManagerImpl.java:103) E/AmazonAppstore.IAP/AbstractPurchaseFragment(26295): ... 8 more W/BroadcastQueue( 831): Permission Denial: receiving Intent { act=com.amazon.venezia.command.analytics.LifecycleEvent flg=0x10 (has extras) } to com.amazon.ven ezia/com.amazon.mas.client.analytics.TailwindBroadcastReceiver requires com.amazon.mas.client.GLOBAL_BROADCAST-com.amazon.mShop.android due to sender com.amazon .mShop.android (uid 10016) I/AmazonAppstore.BasicUserPreferences(26295): Reading from content://com.amazon.mas.client.settings/boolean/com.amazon.mas.client.framework.SettingsService.Coll ect3pAppUsage It's coming from the guts of the Amazon IAPplugin from Unity. I call AmazonIAP.initiateItemDataRequest in the beginning. What else can I do??? Any help is 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.

Csaba Toth avatar image
Csaba Toth answered
Hello?!?!?! Is there anybody out here?
10 |5000

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

Csaba Toth avatar image
Csaba Toth answered
Solution: refresh in-app-purchasing-1.0.3.jar in the guts of the Unity plugin supplied by Amazon with in-app-purchasing-1.0.20.jar. Besides that I added a call to initiateGetUserIdRequest, not sure how much that matters: initiateItemDataRequest worked before without that. So one of these changes or both of them made the headache go away. No I have 3 calls in the Unity game/app: 1. AmazonIAP.initiateItemDataRequest (QueryInventory ()); // QueryInventory is my own function, I know my inventory right now, I don't build it dynamically. 2. AmazonIAP.initiateGetUserIdRequest (); // Still during IAP initialization 3. AmazonIAP.initiatePurchaseRequest(itemID); // itemId is the SKU string I utilize the AmazonIAPEventListener.cs supplied by the IAP plugin almost as it is, I just needed to wire in the increase of the game's virtual currency: void purchaseSuccessfulEvent( AmazonReceipt receipt ) { AmazonIAP.Log("purchaseSuccessfulEvent: " + receipt ); PlayerCredits.AddPlayerCredits (receipt.sku); } Hope this helps others!
10 |5000

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

Csaba Toth avatar image
Csaba Toth answered
. Message was edited by: Csaba Toth
10 |5000

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