- Home /
Codeless IAP not working on phone
Hi all,
Ive been trying to get the codeless IAP working on my current project, ive got it all working fine in the editor, setup the products on the google play developer console, checked the ID's match, added my developer email for testing, etc but I cant get anything to happen when you click the buy button in game on an android device.
Im using the latest unity build and have updated all my SDK's to the latest.
Any suggestions would be greatly appreciated.
Thanks.
I have been searching more for a solution and cant find anywhere using the codeless IAP system that asks for the google public key, could this be the issue and does anyone know how you set it using the codeless IAP?.
Thanks
no that is not issue for me also it asks for google public key in the editor that is only for revenue details
I'm having this same problem. Hope you get an answer from someone. Are you also seeing this issue that I'm having with Codeless IAP in the editor: LIN$$anonymous$$
Answer by rogaroga · Jan 27, 2017 at 03:22 AM
Is the problem that you are testing from the same google account as publisher's account? Found this as I have the same issue:
"NOTE: A restriction against using the publisher’s Google Account for testing exists, because Google payments does not let you buy items from yourself. Therefore you will need to create a non-publisher Google Account for testing."
SOURCE: https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
EDIT: In case someone does come by this thread, I found the solution to my problem, and what may be the original posters problem. The symptom was IAP buttons in editor working in so far as they activated the Fake Store, but then those same buttons doing absolutely nothing when clicked in game after building the project (in my case to android). I found that in my purchase handling script my references were not correct. I failed to specifically identify the GooglePlay store ID. My working code ended up looking like this:
public static string Coins150 = "150coins";
public static string Coins900 = "900coins";
public static string Coins2000 = "2000coins";
public static string Coins5000 = "5000coins";
public static string Coins30000 = "30000coins";
// Apple App Store-specific product identifier.
// Google Play Store-specific product identifier.
private static string kProductNameGooglePlayCoins150 = "150coins";
private static string kProductNameGooglePlayCoins900 = "900coins";
private static string kProductNameGooglePlayCoins2000 = "2000coins";
private static string kProductNameGooglePlayCoins5000 = "5000coins";
private static string kProductNameGooglePlayCoins30000 = "30000coins";
void Start()
{
// If we haven't set up the Unity Purchasing reference
if (m_StoreController == null)
{
// Begin to configure our connection to Purchasing
InitializePurchasing();
}
}
public void InitializePurchasing()
{
// If we have already connected to Purchasing ...
if (IsInitialized())
{
// ... we are done here.
return;
}
// Create a builder, first passing in a suite of Unity provided stores.
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Add a product to sell / restore by way of its identifier, associating the general identifier
// with its store-specific identifiers.
builder.AddProduct(Coins150, ProductType.Consumable, new IDs(){ {kProductNameGooglePlayCoins150, GooglePlay.Name} });
builder.AddProduct(Coins900, ProductType.Consumable, new IDs(){ {kProductNameGooglePlayCoins900, GooglePlay.Name} });
builder.AddProduct(Coins2000, ProductType.Consumable, new IDs(){ {kProductNameGooglePlayCoins2000, GooglePlay.Name} });
builder.AddProduct(Coins5000, ProductType.Consumable, new IDs(){ {kProductNameGooglePlayCoins5000, GooglePlay.Name} });
builder.AddProduct(Coins30000, ProductType.Consumable, new IDs(){ {kProductNameGooglePlayCoins30000, GooglePlay.Name} });
i have the same issue and tried with your code suggestion but not yet working @rogaroga
Your answer
![](https://koobas.hobune.stream/wayback/20220612105639im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
In Unity Services, can Managers in an organisation integrate IAP or do they need to be Owners ? 0 Answers
UnityIAP not restoring purchases on Android 1 Answer
Simple IAP System (SIS) Call back is not working (HandleSuccessfulPurchase is not called) 0 Answers
Unity IAP iOS sign in issue. Asking for Apple ID, but not allowing user to do so 1 Answer
UnityIAP 2019.1.4f1 Fix? 0 Answers