question

taibd avatar image
taibd asked

initiateItemDataRequest not working - Unity

On the start of my app we call initiateItemDataRequest, but the app then hangs and no eventlistener callbacks are called. This happens with both the tester sdk and live beta builds. What could be the issue here? Thanks, T
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.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Taibd Could you please let us know how your Unity project is setup within the initial scenes of your game when you are making the call to initiateItemDataRequest? Do you have the AmazonIAPManager and the IAP Event Listener GameObjects in the scene at the time that you attempt to make this call? In addition, did you setup the Android Manifest file to include the appropriate permissions?(This would be accomplished by going to the Amazon menu in the Unity editor after you load our plugin and use the "Generate AndroidManifest.xml file" menu option.
10 |5000

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

taibd avatar image
taibd answered
Ok I have more details about the issue. I have installed IAP v2 as suggested and now I get this upon initialisation: I/PurchasingManager( 4946): Purchasing Framework initialization complete. Build ID 1.0.3 D/PurchasingManager( 4946): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: com.amazon.AmazonIAPPlugin@41732080 D/SandboxRequestHandler( 4946): In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest D/SandboxRequestHandler( 4946): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest D/SandboxRequestHandler( 4946): In App Purchasing SDK - Sandbox Mode: sendItemDataRequest W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): Error parsing offset: W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): java.lang.NumberFormatException: Invalid long: "" W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at java.lang.Long.invalidLong(Long.java:125) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at java.lang.Long.parseLong(Long.java:346) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at java.lang.Long.parseLong(Long.java:319) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at com.amazon.sdktestclient.iap.command.PurchaseUpdatesCommandHandler.parseOffset(PurchaseUpdatesCommandHandler.java:122) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at com.amazon.sdktestclient.iap.command.PurchaseUpdatesCommandHandler.executeRequest(PurchaseUpdatesCommandHandler.java:49) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at com.amazon.sdktestclient.iap.command.IapCommandHandler.execute(IapCommandHandler.java:59) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at com.amazon.sdktestclient.command.CommandBroker.onHandleIntent(CommandBroker.java:30) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at android.os.Handler.dispatchMessage(Handler.java:99) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at android.os.Looper.loop(Looper.java:137) W/AmazonAppTester/PurchaseUpdatesCommandHandler( 4849): at android.os.HandlerThread.run(HandlerThread.java:60) I/Unity ( 4946): Amazon Insights: onSdkAvailableEvent. isTestMode: True The app hangs after this. What is the error here? Thanks, T
10 |5000

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

taibd avatar image
taibd answered
Resolved. The issue was that the scene was reloaded too quickly after initiateItemDataRequest.
10 |5000

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