Hi, I need help. In my game I use iAp, and there is some Non-Consumable and Consumable product. In short Apple reject my game because I need include some mechanism for restore purchase.
So what is the best solution for that.
For example for buy Non-Consumable items I use, and works fine:
public void BuyNonConsumable1()
{
//Buythenon-consumableproductusingitsgeneralidentifier.Expectaresponseeither
//throughProcessPurchaseorOnPurchaseFailedasynchronously.
BuyProductID(kProductIDNonConsumable2);
}
The problem is how can I implement RestorePurchase?
I have several items and each set values in PlayerPrefs. How can I know is there was Restored all purchases and if player buy only one or two items how can I know which one I was restore.
In example script there is :
public void RestorePurchases()
{
if (!IsInitialized())
{
Debug.Log(“RestorePurchasesFAIL.Notinitialized.”);
return;
}
if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.OSXPlayer)
{
Debug.Log(“RestorePurchasesstarted…”);
var apple = m_StoreExtensionProvider.GetExtension();
apple.RestoreTransactions((result) => {
Debug.Log(“RestorePurchasescontinuing:” + result + “.Ifnofurthermessages,nopurchasesavailabletorestore.”);
});
}
else
{
Debug.Log(“RestorePurchasesFAIL.Notsupportedonthisplatform.Current=” + Application.platform);
}
}