- Home /
IAP - What am I missing?
OK, so I have tried to implement unity's IAP but I am... stuck.
I am only looking at android at present. I have signed up and created an app with Google Play.
I have tried following multiple guides, and here is what I am left with essentially in the project at this point. I enabled unity ads from the services window, and imported all of the stuff from there to the Plugins folder.
I have taken the "Purchaser" script from here: https://unity3d.com/learn/tutorials/topics/analytics/integrating-unity-iap-your-game and modified it to my own needs. I only have 1 product, which is a non consumable. I hooked it up to check this properly etc. In editor, it works as expected.
I submitted the APK to google play on my alpha testing platform, but the buy button does nothing once its uploaded there and I update on device. (I definitely have the right version).
The product I have was also created as an item for the app on Google play. Its identifier follows the pattern: "com.companyname.appname.productname" Then, in the purchaser script I set the Consumable Item name as such:
public static string kProductIDNonConsumable = "com.companyname.appname.productname";
This is the product I am buying when I press the buy button, and the product I check for in ProcessPurchase().
So... Any ideas why it functions in editor etc, but when I build it and put it on google play it does nothing?
Answer by nicholasr · Jul 05, 2016 at 03:14 AM
Hi @pingu2k4 It sounds like many steps have already been made. Have you also seen the Google Play for Unity IAP documents: http://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html This walks through the process, and may help to catch any missed step.
Have you inspected the Android Log when running the application, after pressing the Buy button, to see if any warnings or other information is emitted?
Also, it's unlikely you'll need this now, but we made an FAQ for Unity IAP http://forum.unity3d.com/threads/unity-iap-faqs.388069/