- Home /
no product available in app purchaser unity 5.3.1f1 ?
I am testing its products with the print function of unity Purchaser 5.3 app, but build on a device when it encountered this error "no product available" in function UnityPurchasing.Initialize, someone can help me fix this error does not, thanks a lot
I am in the same issue! you figured it out ? how to do this?
Answer by Nihil688 · Feb 06, 2016 at 02:32 PM
Hey that's because their documentation is 100% wrong,
don't use: public Purchasing.ConfigurationBuilder AddProduct(string id, Purchasing.ProductType type, Purchasing.IDs storeIDs);
as id is not store independent as they say...
Well, mate. Can you show us the way of doing it? @Nihil688 .Thanks a lot.
@reinaldozhang use the other method available in the api: public Purchasing.ConfigurationBuilder AddProduct(string id, Purchasing.ProductType type); since the id isnt independent, you use the method that requires it to be dependant
Using
ConfigurationBuilder.AddProduct(IAP_STORE_ID, ProductType.NonConsumable);
ins$$anonymous$$d of
ConfigurationBuilder.AddProduct(IAP_STORE_ID, ProductType.NonConsumable, new IDs
{
{IAP_STORE_ID, GooglePlay.Name}
});
Worked for me. Thank you.
Answer by mohammed29 · Apr 25, 2016 at 04:30 AM
I had this problem and finally i fixed it :)
Just you need to follow the Docs : http://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
Anyway, I will give you the direct answer >>
This error occurs because you didn't publish your app , therefore you need the following..
Go to Developer Console and make an Alpha version of your app. don't forget to Add Testers to your alpha. (add yourself at least)
Press Publish Button in order to publish the Alpha .
Copy the (testers download link) you will provided (bottom of the page) and paste it in your mobile browser.
After open the link in mobile browser, You will redirect to Play Store and you can download your own app now, (you should download it directly from the store in order to make (in-app Purchases work)
And your code should be work correctly without errors :)
This is how i initialize IAP :
ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct("[id]", ProductType.Consumable);
builder.Configure<IGooglePlayConfiguration>().SetPublicKey("[public key- you can find it out from Services/API tab in developer console]");
UnityPurchasing.Initialize(this, builder);
Your answer
Follow this Question
Related Questions
Can't understand OpenIAB skus 0 Answers
ingameshop tutorial c# 1 Answer
i need a script to remove ads by with an in app purchase subscrition 0 Answers
Can't import IAP store package 0 Answers
How to handle IAP refund in iOS? 0 Answers