question

C. Ata avatar image
C. Ata asked

IAP only working in Sandbox Mode

Hi All, IAP keeps failing for me in Live mode. I've tested on several devices and emulators in Sandbox mode and everything works fine. QA is telling me it's failing in Live mode with the following error: "An error occurred while processing your purchase." In the log file I got from them I don't see any exceptions or error prints outs from my app. The only suspicious thing I see is the following error in AmazonAppStore IAPBridge: 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): exception in getCatalogItemDetails PropertyMap:{ Name:Log RecordType:Log LogLevel:Error LogTag:IapBridge Throwable:java.lang.NullPointerException MessageContents:exception in getCatalogItemDetails }; 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): java.lang.NullPointerException 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at com.amazon.mas.client.framework.cat.real.RealCatalogService.getCatalogItemDetails(RealCatalogService.java:59) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at com.amazon.mas.client.framework.cat.AbstractCatalogService.getCatalogItemDetails(AbstractCatalogService.java:40) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at com.amazon.venezia.iap.IapProvider.getCatalogItemDetailsJson(IapProvider.java:165) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at com.amazon.venezia.iap.IapBridge.getCatalogItemDetails(IapBridge.java:74) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.BrowserFrame.stringByEvaluatingJavaScriptFromString(Native Method) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.BrowserFrame.stringByEvaluatingJavaScriptFromString(Native Method) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.BrowserFrame.loadUrl(BrowserFrame.java:246) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.WebViewCore.loadUrl(WebViewCore.java:1868) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.WebViewCore.access$1900(WebViewCore.java:71) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1046) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.os.Handler.dispatchMessage(Handler.java:99) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.os.Looper.loop(Looper.java:143) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:667) 01-17 16:05:56.639: E/AmazonAppstore.IapBridge(2325): at java.lang.Thread.run(Thread.java:1027) I'm totally stuck on this. I've read all the documentation, tested all my IAP items on my devices and emulators, and revisited the code. Any suggestions? Thanks, Chad
iap
10 |5000 characters needed characters left characters exceeded

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

Anshul@Amazon avatar image
Anshul@Amazon answered
Since this is an App specific issue, please raise a ContactUs ( https://developer.amazon.com/help/contactus.html) with your app details and one of our support engineers will help you fix the issue.
10 |5000 characters needed characters left characters exceeded

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

C. Ata avatar image
C. Ata answered
Will do, thanks.
10 |5000 characters needed characters left characters exceeded

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

aidigame avatar image
aidigame answered
Hi sheado, I've encountered the same problem in the recent and have been stuck with the issue for several days.Have you resolved your problem?
10 |5000 characters needed characters left characters exceeded

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

C. Ata avatar image
C. Ata answered
Hey there, My app is still pending review since the last build, but I think we at least fixed the most recent issue. We had our min sdk level set to 7 and figured it would be ok since devices with SDK <10 would not return onSDKAvailable() for IAP (which we were using to active/deactivate our IAP buttons). This assumption was wrong - it does return true on <10 level devices. In that case, the QA people were seeing our IAP buttons on those devices, pressing the IAP buttons, and watching them fail. So our fix was to raise the min level to 10. Hope that helps, -Chad
10 |5000 characters needed characters left characters exceeded

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

Sachin@Amazon avatar image
Sachin@Amazon answered
Hi Sheado, Thank you for your reply. This will surely help other developers as well.
10 |5000 characters needed characters left characters exceeded

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

C. Ata avatar image
C. Ata answered
Ok, IAP fail happened again and app got rejected a 3rd time. The higher api level was probably a good idea anyway, but this issue must be something else. I didn't get any error logs from QA - error occurred on OS/Device(s)/Form Factor:3.2/Samsung tab/Phone+Tablet (IAP buttons were visible, but the error popup displayed again when trying to use them) I had already contacted support last time the issue occurred and they told me it might have had to do with onSDKAvailable() not enabling/disabling the buttons (which it wasn't). The second time they confirmed that raising the min level could help (which it didn't). At this point, I don't know what else to try. I retested on 3.2 with SDK tester and everything worked fine. I could uncheck the "All non-Amazon Android devices based on my manifest" box, but I'd rather not do that if possible. I've also tested on a physical Kindle device, all versions of the Kindle emulator, and several non-Kindle devices and emulators - all with success. It's quite frustrating not being able to exactly reproduce QA's scenarios. @aidigame did you resolve your issue? Any suggestions would be much appreciated! Thanks, -Chad
10 |5000 characters needed characters left characters exceeded

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

aidigame avatar image
aidigame answered
Hi Sheado, Thank you very much for detailed reply.Since I didn't get the error log from amazon's feedback,I had no idea what happened with our app when tapping any in-app item in live environment.I just try to make some changes to fix our issue. In the version we submitted yesterday,I invoked the initiateGetUserIdRequest method to retrieve the amazon client ID as the online documentation indicated.I didn't do that before cause IAP function worked great without invoking the method in sandbox mode and we also could retrieve the client ID from the purchaseResponse object. Besides,our min sdk level had been 7 before I could see your reply and I had set it to 10 as you did before this submission.Hope to get through amazon's review.Your reply has helped me a lot and thanks again.Good luck:)
10 |5000 characters needed characters left characters exceeded

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

C. Ata avatar image
C. Ata answered
Hi aidigame, I also wasn't calling initiateGetUserIdRequest() and after the first rejection I also decided to add that in, in case it had anything to do with. It still got rejected, but I think checking for the user id helps more accurately identify if IAP is available on a device. After setting the level to 10, it still got rejected, but I think it was probably a good idea anyway. Last night I resubmitted once again after talking to support. They told me it may have to do with the fact that my previous version is set to Antartica (I did that to prevent downloads of the previous version while we fixed bugs). Support gave me some instructions to forward to QA and asked me to resubmit. Lesson learned is that if your previous version is very old or limited to certain locations then you might want to ask support for help and clarify to them your deployment details. Hopefully it will get through this time! good luck! -Chad
10 |5000 characters needed characters left characters exceeded

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

Anshul@Amazon avatar image
Anshul@Amazon answered
Hi Chad, Your IAP issue has been fixed and the app should be available on store now.
10 |5000 characters needed characters left characters exceeded

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

C. Ata avatar image
C. Ata answered
Thanks @anshul, Game is live now and things to be working fine.
10 |5000 characters needed characters left characters exceeded

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