Beispiel #1
0
 public virtual void OnRestorePurchasesSuccess(PurchaseInfoResponse response)
 {
     response.purchaseInfoList.ForEach(purchaseInfo => {
         Debug.Log("Restores purchase for " + purchaseInfo.productId);
         switch (purchaseInfo.productId)
         {
         default:
             break;
         }
     });
 }
Beispiel #2
0
    public override void OnRestorePurchasesSuccess(PurchaseInfoResponse response)
    {
        response.purchaseInfoList.ForEach(purchaseInfo => {
            Debug.Log("you bought " + purchaseInfo.productId);
            switch (purchaseInfo.productId)
            {
            case "no_ads":
                shopManager.setNoAds(true);
                break;

            case "premium":
                shopManager.setPremium(true);
                break;
            }
        });
    }
Beispiel #3
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    /// <param name="response">Response</param>
    public void OnResult(int resultCode, PurchaseInfoResponse response)

    {
#if DEBUG
        Debug.Log("get Purchase Info callback");
#endif

        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();

        if (resultCode == 0)
        {
            callbacksHandler.OnRestorePurchasesSuccess(response);
        }
        else
        {
            callbacksHandler.OnRestorePurchasesError(resultCode);
        }
    }