Plug-in chicken and egg situation

We’ve implemented the plug-in in an app.  When testing using the Amazon SDK Tester, IAP works with no issues.  When testing on device directly, we get an app hang because the IAP item is not yet associated with an approved app as shown in this adb logcat capture:

V(&nbsp; 207:0xdc) accel data: -0.119751 -0.088616 9.766890 D(12332:0x302d) GC\_CONCURRENT freed 4365K, 68% free 12707K/39111K, paused 1ms+3ms V(12332:0x303e) \> Class.forName: plugin.amazon.iap.LuaLoader V(12332:0x303e) \< Class.forName: plugin.amazon.iap.LuaLoader V(12332:0x303e) Loading via reflection: plugin.amazon.iap.LuaLoader I(12332:0x3065) Purchasing Framework initialization complete. Build ID 1.0.3 D(12332:0x303e) In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@4163d328 D(12332:0x3065) In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest W(&nbsp; 207:0x27b) Unable to start service Intent { act=com.amazon.testclient.iap.appUserId flg=0x10000000 (has extras) }: not found &nbsp;

APP HANG HERE

The last line in the logcat capture above identifies the problem -  the reason that the service couldn’t start is that the app has not been approved by Amazon.

Therefore, you can ONLY use the SDK Tester to test IAP before approval.

Reference article:  http://stackoverflow.com/questions/13559565/i-am-using-a-amazone-purchasing-api-and-this-types-of-error-occured-into-the-log

So here’s the interesting problem - we submitted the app to Amazon for approval and they rejected it - because of the hang that occurred when they tested it!

Anyone have suggestions on how to address this?

Well for everyone’s edification, there apparently was some kind of race condition occurring between the Corona SDK and the plug-in which got resolved when we switched from build 1181 to build 1202 (the latest public release.)  We recompiled our application and submitted it to Amazon with successful approval today.

Congrats!

Well for everyone’s edification, there apparently was some kind of race condition occurring between the Corona SDK and the plug-in which got resolved when we switched from build 1181 to build 1202 (the latest public release.)  We recompiled our application and submitted it to Amazon with successful approval today.

Congrats!

Hmm. I am having what appears to be the same issue, but with Corona build 1211.

My purchases work fine using the Amazon SDK Tester app on my Nexus 7. (I’ve also tried kindle fire before but I don’t have it with me right now.)

My in-app purchases are “Status: Live” on Amazon (note you can make them live before you submit your app).

For testing locally, I am using the JSON file that I downloaded from Amazon’s in-app purchase page, so it should match exactly.

I submitted my app and it was rejected because the testers saw a “blank screen” on the store – which I think means that the store didn’t properly load. Just like tschussler, I cannot really debug this any further since I can’t test on amazon’s servers.

tschussler suggests that the problem righted itself somehow for him, but with an older build than i am using. Should I just resubmit and hope for the best?

I am confused as to what the right course of action is now… Does anybody know how the race condition happens?

EDIT:

I do have the following lines in my store.lua (following the tutorial):

store.init(transactionCallback)

timer.performWithDelay (1000, setupMyStore)

Any chance the 1000ms delay is not enough for amazon?

I found out from Amazon (they sent me the adb log) that when they test the app they see 2 products, but I have 3 products. 

It looks like they are seeing the 2 consumable items, but not seeing the subscription item.

(All 3 items show up when I use the downloaded amazon.sdktester.json)

Has anyone ever seen problems with subscription items?

I eventually got my Amazon IAP working and up on the amazon store!

http://www.amazon.com/Megafauna-Software-Brain-Yoga/dp/B00FOQ0S70/ref=sr_1_2?s=mobile-apps&ie=UTF8&qid=1382106969&sr=1-2&keywords=brain+yoga

I had two issues:

  1. For some reason, my subscription product did not get submitted properly. It was Live according to the Amazon dashboard but did not appear in my list of valid products. The solution was to resubmit my IAPs. Amazon says this was a problem on their end. I recommend printing out which products were returned from the server, since Amazon sent me the logcat and that’s the only way I could see what was wrong.

  2. The amazon.sdktester.json file (downloadable from the Amazon Mobile Developer site for testing) has prices set as numbers (e.g., 9.99). I was formatting these numbers to two decimal places in case they were of type float. However, the amazon live test is inconsistent with the test data since it returns a string with a currency symbol (e.g. “$9.99”) so my code to format the number with two decimal places failed with an error. The solution was to eliminate this line of code and just show the localizedPrice directly. 

Hmm. I am having what appears to be the same issue, but with Corona build 1211.

My purchases work fine using the Amazon SDK Tester app on my Nexus 7. (I’ve also tried kindle fire before but I don’t have it with me right now.)

My in-app purchases are “Status: Live” on Amazon (note you can make them live before you submit your app).

For testing locally, I am using the JSON file that I downloaded from Amazon’s in-app purchase page, so it should match exactly.

I submitted my app and it was rejected because the testers saw a “blank screen” on the store – which I think means that the store didn’t properly load. Just like tschussler, I cannot really debug this any further since I can’t test on amazon’s servers.

tschussler suggests that the problem righted itself somehow for him, but with an older build than i am using. Should I just resubmit and hope for the best?

I am confused as to what the right course of action is now… Does anybody know how the race condition happens?

EDIT:

I do have the following lines in my store.lua (following the tutorial):

store.init(transactionCallback)

timer.performWithDelay (1000, setupMyStore)

Any chance the 1000ms delay is not enough for amazon?

I found out from Amazon (they sent me the adb log) that when they test the app they see 2 products, but I have 3 products. 

It looks like they are seeing the 2 consumable items, but not seeing the subscription item.

(All 3 items show up when I use the downloaded amazon.sdktester.json)

Has anyone ever seen problems with subscription items?

I eventually got my Amazon IAP working and up on the amazon store!

http://www.amazon.com/Megafauna-Software-Brain-Yoga/dp/B00FOQ0S70/ref=sr_1_2?s=mobile-apps&ie=UTF8&qid=1382106969&sr=1-2&keywords=brain+yoga

I had two issues:

  1. For some reason, my subscription product did not get submitted properly. It was Live according to the Amazon dashboard but did not appear in my list of valid products. The solution was to resubmit my IAPs. Amazon says this was a problem on their end. I recommend printing out which products were returned from the server, since Amazon sent me the logcat and that’s the only way I could see what was wrong.

  2. The amazon.sdktester.json file (downloadable from the Amazon Mobile Developer site for testing) has prices set as numbers (e.g., 9.99). I was formatting these numbers to two decimal places in case they were of type float. However, the amazon live test is inconsistent with the test data since it returns a string with a currency symbol (e.g. “$9.99”) so my code to format the number with two decimal places failed with an error. The solution was to eliminate this line of code and just show the localizedPrice directly.