Unity IAP识别ProcessPurchase方法上的已恢复项

时间:2016-12-23 12:01:19

标签: unity3d in-app-purchase

是否有方法或策略来了解何时从还原项调用ProcessPurchase?

我正在寻找iOs和Google

2 个答案:

答案 0 :(得分:0)

在这里: https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html

/// <summary>
/// Your IStoreListener implementation of OnInitialized.
/// </summary>
public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
{
    extensions.GetExtension<IAppleExtensions> ().RestoreTransactions (result => {
        if (result) {
            // This does not mean anything was restored,
            // merely that the restoration process succeeded.
        } else {
            // Restoration failed.
        }
    });
}

答案 1 :(得分:0)

我希望这可以提供帮助:https://unity3d.com/cn/learn/tutorials/topics/analytics/integrating-unity-iap-your-game

相关代码,来自代码示例:

public void BuyNonConsumable()
{
    // Buy the non-consumable product using its general identifier. Expect a response either 
    // through ProcessPurchase or OnPurchaseFailed asynchronously.
    BuyProductID(kProductIDNonConsumable);
}