question

lionbi4 avatar image
lionbi4 asked

Exception while making a payment from Unity3d IAP library

Hi, When making a payment I receive the following: INFO/Unity(32176): AndroidJavaException: java.lang.IllegalStateException: You must register a PurchasingObserver before invoking this operation at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0 at UnityEngine.AndroidJNISafe.CallVoidMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0 at UnityEngine.AndroidJavaObject._Call (System.String methodName, System.Object[] args) [0x00000] in :0 at UnityEngine.AndroidJavaObject.Call (System.String methodName, System.Object[] args) [0x00000] in :0 at AmazonIAP.initiatePurchaseRequest (System.String sku) [0x00000] in :0 Is there any solutions to fix it for Unity3d ? Is there any ways to register PurchasingObsever in Unity library? Thanks Leonard
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.

lionbi4 avatar image
lionbi4 answered
Found answer: // Sends off a request to fetch all the avaialble products. This MUST be called before any other methods public static void initiateItemDataRequest( string[] items ) {
10 |5000

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

lionbi4 avatar image
lionbi4 answered
Another problem: 01-30 15:56:54.582: DEBUG/SandboxRequestHandler(2578): In App Purchasing SDK - Sandbox Mode: sendPurchaseRequest 01-30 15:56:54.582: WARN/ActivityManager(1993): Unable to start service Intent { act=com.amazon.testclient.iap.purchase flg=0x10000000 (has extras) }: not found Anyone?
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi, Can you please make sure that IAP SDK Tester is installed in your device? Please refer below documentation for IAP testing guideline in your app, https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs/testing-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.