IOS app rejected due to unity IAP IPV6 Issue.
Its literally my first game!
notes:
- IAP functioning 100% on android!
- button dims when pressed so clearly it shows if its clicked or not.
- once button is pressed it also clearly shows its already owned non-consumable.
- when I turn my mac to IPV6 router.. then connect my iphone to it .. then I test the button again nothing happens!
code:
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
public class MyIAPManager1 : MonoBehaviour, IStoreListener
{
private static IStoreController m_StoreController;
private static IExtensionProvider m_StoreExtensionProvider;
void Start()
{
if (m_StoreController == null)
{
InitializePurchasing();
}
}
public void InitializePurchasing()
{
if (IsInitialized())
{
return;
}
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct("TankCannon", ProductType.NonConsumable, new IDs() { { "tankcannon5", GooglePlay.Name },{"TankCannon5", AppleAppStore.Name}});
builder.AddProduct ("continue", ProductType.Consumable, new IDs{ { "continue1", GooglePlay.Name } ,{"continue1", AppleAppStore.Name}});
UnityPurchasing.Initialize(this, builder);
}
private bool IsInitialized()
{
return m_StoreController != null && m_StoreExtensionProvider != null;
}
public void BtnBuyTankCannon5()
{
BuyProductID("TankCannon");
}
public void BtnBuyContinue1(){
BuyProductID ("continue");
}
public void BuyNonConsumable()
{
// Buy the non-consumable product
}
public void BuySubscription()
{
// Buy the subscription product using its the general identifier.
}
void BuyProductID(string productId)
{
try
{
if (IsInitialized())
{
Product product = m_StoreController.products.WithID(productId);
if (product != null && product.availableToPurchase)
{
Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id));
m_StoreController.InitiatePurchase(product);
}
else
{
Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
}
}
else
{
Debug.Log("BuyProductID FAIL. Not initialized.");
}
}
catch (Exception e)
{
Debug.Log("BuyProductID: FAIL. Exception during purchase. " + e);
}
}
public void RestorePurchases()
{
if (!IsInitialized())
{
Debug.Log("RestorePurchases FAIL. Not initialized.");
return;
}
if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.OSXPlayer)
{
Debug.Log("RestorePurchases started ...");
var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
apple.RestoreTransactions((result) => {
Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
});
}
else
{
Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform);
}
}
public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
{
Debug.Log("OnInitialized: PASS");
m_StoreController = controller;
m_StoreExtensionProvider = extensions;
}
public void OnInitializeFailed(InitializationFailureReason error)
{
Debug.Log("OnInitializeFailed InitializationFailureReason:" + error);
}
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
if (String.Equals(args.purchasedProduct.definition.id, "continue", StringComparison.Ordinal))
{
Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
Debug.Log ("CONSUMABLE ADDED 10");
this.GetComponent<_ManagerScript>().SuccessfulBulletsContinue();
}
else
if (String.Equals(args.purchasedProduct.definition.id, "TankCannon", StringComparison.Ordinal))
{
Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
Debug.Log("this is TankCannon Success");
PlayerPrefs.SetInt("Tank_Bang_Cannon_Add", 5);
this.GetComponent<__ManMenu>().ShowCongratulationsMessage();
}
else
{
Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
}
return PurchaseProcessingResult.Complete;
}
public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
{
// A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing this reason with the user.
Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason));
}
}
Comment
Your answer

Follow this Question
Related Questions
C# 2D Top down game how to detect if objects are touching while they can pass through each other? 1 Answer
Trying to move UI Elements but they are not working 1 Answer
Camera Movement Question - How to follow player in Y axis only above certain threshold? 0 Answers
How to check if player is rapidly rotating the joystick? 2 Answers
Object jumping between the touch 0 Answers