question

Jack Cooney avatar image
Jack Cooney asked

Unity IAP2.0. Not working.

Hi, I'm trying to implement an IAP in a unity game using the IAP 2.0 plugin. I can successfully GetUserData using the app tester app but thats the only thing that works. The Apptester app always returns an empty dictionary when i call GetProductData(); with a "SUCCESSFUL" setting, and both the game and the apptester app crash when attempting to purchase. I hoped that it could be that the App tester was unable to find the JSON file so i moved onto Live testing the app and IAP. But even then i get the "an error occurred message" and in the console logs it says that the yap is an INVALID_SKU The IAP is approved on the amazon dash and the JSON file for the app tester is placed in the /SDCARD directory of my testing phone. The IAP sku is named: HHN_RemoveAds. Any help would be greatly apprieciated. Message was edited by: rhiojin
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.

Jack Cooney avatar image
Jack Cooney answered
The solution here is to NOT use v2.0 as suggested by customer services. I have managed to successfully make purchases with v1.0 on the live test environment. A few tips for v1.0 for anyone just starting out with this: It is not very clear from the documentation that you have to replace the in-app-purchases1.0.3.jar that comes in the .unitypackage with the 1.0.20.jar located in the downloaded files. I was unable to get the SDKtester app to read the json file located on my test devices. If you are having this problem, chances are that the SDKtester isn't configured properly somehow OR it just doesn't work with your device for what ever reason.If you are able to see the onPurchaseResponse called messages in the logs but receive no further interactions from the SDKtester app then I would suggest testing your app on the live testing environment. If you are not receiving any callbacks even though in your scripts you subscribed to the events from the AmazonIAPManager then chances are that you have not placed the AmazonIAPManager prefab into your scene; no call backs are fired if this isn't present when the iap flow is initiated. If you take it a step further and integrate Gamecircle, always remember to sign your game with the same keystore you created the API Key with. The Gamecircle expects that your api_key file remains in the Assets > Android > assets folder (not to be confused with the root folder thats also names Assets); Hope this helps as I spent a great deal of time researching the tidbits needed to piece together this jigsaw system.
10 |5000

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

justin avatar image
justin answered
Thanks for sharing these 1.0 tips, rhiojin, and sorry for the delay. Unfortunately, I haven't had any issues testing an app using V2 in Unity; if you could share your code we'd be more than happy to take a further look at things.
10 |5000

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

alternativerichie avatar image
alternativerichie answered
I'm trying to implement IAP2.0 now. I'm having the same problem. I get nothing back with GetProductData, tried my hardest to follow everything. ProductDataResponseHandler works but when I try to retrieve the sku from ProductDataMap it can't find the key so I can't get any product data. Put the json in the correct place. Using the sample code given. Running App Tester. With the deepest respect, saying that you haven't had any issues doesn't help. How about a, here's precisely how I did it and it works. I found the documentation and examples to be all over the place and it's been a real chore to put this together. Just one single tutorial v2 Unity step by step would have done, covering everything... Common problem across stores though, I don't know why but there is a trend towards the unproductive and we tend to have to find answers in forums. Having said that, I do appreciate the work that has gone in to it, as we would have a much harder time if nothing was done, as Unity opted to initially not support Amazon in their purchasing API.
10 |5000

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

alternativerichie avatar image
alternativerichie answered
For anyone else who comes along here. I followed some advice on this post to get it to work. http://stackoverflow.com/questions/10541809/testing-in-app-purchases-in-kindle-fire-application I went to Manage All Applications->Amazon App Tester on my device. Force stop, then Clear data. Disconnected it from my Mac. I then powered off the device and restarted it. Ran Amazon App Tester, then my game and then GetProductData started to work. It's also now working while plugged into the Mac and connected through Android Device Monitor. I think it may have been the clear data and restart that did it.
10 |5000

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