- Home /
Unity IAP + Google Play Promo Codes
Hello there.
The second day I try to integrate into my Android game a system of promotional codes from Google (in my case - for making "consumable purchases"). The Unity IAP plug-in is installed and works, as well as the "playgameservices" plug-in. Codes received, but after activation and transition to the application there is no reaction. Tried to run the script of purchases right after the game start - the same.
The only more or less complete answer found here: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1090 But this also did not help.
Here is my initialization code for purchases:
public void InitializePurchasing()
{
if (IsInitialized())
return;
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
foreach (string s in C_PRODUCTS) builder.AddProduct(s, ProductType.Consumable);
foreach (string s in NC_PRODUCTS) builder.AddProduct(s, ProductType.NonConsumable);
UnityPurchasing.Initialize(this, builder);
}
And the event of purchase:
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
if (C_PRODUCTS.Length > 0)
foreach (string c in C_PRODUCTS)
if (String.Equals(args.purchasedProduct.definition.id, c, StringComparison.Ordinal)) //C_PRODUCTS[currentProductIndex]
OnSuccessC(args);
if (NC_PRODUCTS.Length > 0)
foreach (string c in NC_PRODUCTS)
if (String.Equals(args.purchasedProduct.definition.id, c, StringComparison.Ordinal))
OnSuccessNC(args);
return PurchaseProcessingResult.Complete;
}
Who ever experienced this? What am I doing wrong?
PS: I'm sorry if I'm talking intricately or with mistakes. Rarely I write in English, but I have here also already 3 o'clock in the morning.
Did you ever find the solution? I did try to implement promo codes in our game, but the thing is that the process purchase doesn't get called, and so no items are recieved
Your answer
![](https://koobas.hobune.stream/wayback/20220612121735im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Redeem Code payment option not appearing 0 Answers
IAP Restore purchase on Android "Already Recorded Transaction" 0 Answers
how can I make a IAP Subscription code in unity 2019.1.9 for google play ? 0 Answers
Purchase not being acknowledged on google store 0 Answers
Google Play IAP - "The item you requested is not available for purchase." 1 Answer