Hello everybody.
Need your help. Internal Unity In-app. Unity version: 5.3.1p1
Situation: I make everything well in code (I hope), and then I was tested purchases on real devices with working acount (and with credit card).
And I have a problem with initialising purchases ~1 week already. And can not understnad what wrong.
Error message on start: PurchasesUnavailable. Error on Android.
Windows Store not working too.
May be wrong here? :
// vars:
public class Purchaser : MonoBehaviour, IStoreListener
{
private string B3000 = "2000_gold_coins";
private string B10000 = "10000_gold_coins";
private string ADS = "noads";
// procedure:
public void InitializePurchasing () {
if (IsInitialized ()) {
if (characterController.DebugMode) {
Debug.Log ("AIP already INITED");
}
return;
} else {
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct (ADS, ProductType.Consumable, new IDs
{
{"noads_google", GooglePlay.Name},
{"noads_windows", WindowsPhone8.Name},
{"noads_mac", MacAppStore.Name}
});
builder.AddProduct (B3000, ProductType.Consumable, new IDs
{
{"2000_gold_coins_google", GooglePlay.Name},
{"3000_coins_windows", WindowsPhone8.Name},
{"2000_gold_coins_mac", MacAppStore.Name}
});
UnityPurchasing.Initialize (this, builder);
}
// Call
IAPScript.GetComponent<Purchaser> ().Buy (productString);
// Request
public void Buy (string productId)
{
InitializePurchasing ();
if (IsInitialized ()) {
controller.InitiatePurchase (productId);
}
else {
Debug.LogError ("BuyProductID FAIL. Not initialized.");
AVATAR.GetComponent<characterController>().PurchaseInitFail();
}
}
Thank you!
And Happy New Year!