2014-09-11 105 views
7

我正在嘗試將最新版本的亞馬遜IAP API集成到我的Android 4+應用中。當應用程序被加載到我的測試設備(Nexus 5和Kindle Fire)並與亞馬遜應用程序測試儀一起使用時,一切似乎都可以正常工作。 IAP可以在沒有任何問題的情況下購買。亞馬遜IAP SDK:在實時應用測試中測試IAP時沒有反應

知道我已將該應用的「實時應用測試」版本上傳到亞馬遜商店,並將其安裝在我的測試設備上。運行這個版本IAPs是不可能的。

這是使用側載版本應用程序測試時,日誌輸出:正如你所看到的採購SDK被初始化就好

D/PTLog  (14109): IAPManager - init - using Amazon 

D/d   (14109): In App Purchasing SDK - Sandbox Mode: PurchasingListener registered: [email protected] 
D/d   (14109): In App Purchasing SDK - Sandbox Mode: PurchasingListener Context: xyz 
D/c   (14109): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest/sendGetUserData first:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:1:fca787d5-4b9d-42e4-840f-ff28f3d13ac4 
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.appUserId flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:87 com.amazon.device.iap.internal.a.c.a:150 
D/c   (14109): In App Purchasing SDK - Sandbox Mode: sendItemDataRequest 
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.itemData flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:137 com.amazon.device.iap.internal.d.a:103 
D/c   (14109): In App Purchasing SDK - Sandbox Mode: handleResponse 
I/c   (14109): sendGetPurchaseUpdates with user idl3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU= 
I/c   (14109): send PurchaseUpdates with user id:l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=;reset flag:true, local cursor:null, parsed from old requestId:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:1:fca787d5-4b9d-42e4-840f-ff28f3d13ac4 
W/ContextImpl(14109): Implicit intents with startService are not safe: Intent { act=com.amazon.testclient.iap.purchaseUpdates flg=0x10000000 (has extras) } android.content.ContextWrapper.startService:494 com.amazon.device.iap.internal.a.c.a:421 com.amazon.device.iap.internal.a.c.e:388 
D/c   (14109): In App Purchasing SDK - Sandbox Mode: handleResponse 

。現在,使用Live應用程序的測試版本時,該日誌顯示以下信息:

D/PTLog (18032): IAPManager - init - using Amazon 
D/Kiwi (18032): In App Purchasing SDK - Production Mode: d: PurchasingListener registered: [email protected] 
D/Kiwi (18032): In App Purchasing SDK - Production Mode: d: PurchasingListener Context: [email protected] 
D/Kiwi (18032): In App Purchasing SDK - Production Mode: a: sendGetPurchaseUpdates 
D/Kiwi (18032): Kiwi: WARNING: Use of deprecated method detected. 
E/Kiwi (18032): Kiwi: Kiwi subsystem is not fully initialized. Cannot process task. 
D/Kiwi (18032): In App Purchasing SDK - Production Mode: a: sendGetProductDataRequest 
D/Kiwi (18032): Kiwi: WARNING: Use of deprecated method detected. 
E/Kiwi (18032): Kiwi: Kiwi subsystem is not fully initialized. Cannot process task. 

正如你可以看到有似乎與採購SDK的一個問題:

"Kiwi: WARNING: Use of deprecated method detected." 

不要緊,如果實時應用測試版本用於Kindle或Nexus上最新版本的亞馬遜商店應用。結果完全一樣:IAP不可能。

這是一個已知的問題? 這怎麼解決?

非常感謝你

+0

可能會在這裏得到更快的幫助,http://forums.developer.amazon.com/forums/index.jspa – petey 2014-09-12 17:58:37

+0

當然已經嘗試過,但到目前爲止我沒有得到任何答覆。其實亞馬遜論壇似乎不是一個獲得幫助的好地方。我也直接與亞馬遜聯繫,迄今沒有任何反饋。 – 2014-09-13 06:34:41

+0

雖然論壇帖子大部分時間都是以「聯繫我們」爲主題的,但我也有積極的經驗。可能值得再試一次。 – petey 2014-09-15 13:54:11

回答

4

我終於找到了我的問題中描述的問題的解決方案。對不起,沒有發佈此更早...

有一個hint in the Amazon API docs,它描述了可以用來混淆代碼的一些限制。看起來,如果混淆過強,某些API不再適用。

+0

嗨,我在實時應用測試中遇到同樣的問題。我的應用程序沒有使用Proguard,所以我不認爲有混淆問題。從看亞馬遜論壇也沒有明智的幫助,我可以找到。你做了什麼來解決這個問題? – user1785227 2015-05-21 10:16:19

+1

這是一個好主意來檢查,但沒有解釋我遇到的問題。 FWIW,我有'-keep public class com.amazon。** {*; }'在我的proguard-rules文件中。 – arlomedia 2016-06-03 22:17:07

0

您是否在您的MainActivity.onCreate(...)中註冊Amazon的回調監聽器?

PurchasingService.registerListener(this.getApplicationContext(),new YourCallbackPurchasingListener());

如果你不這樣做,試試看。