private void FireRestoreCompleteEvent()
    {
        IOSStoreKitRestoreResponce r = new IOSStoreKitRestoreResponce(true, null);

        dispatch(RESTORE_TRANSACTION_COMPLETE, r);
        OnRestoreComplete(r);
    }
    public void restorePurchases()
    {
        if (!_IsStoreLoaded)
        {
            IOSStoreKitError e = new IOSStoreKitError();
            e.code        = IOSTransactionErrorCode.SKErrorPaymentServiceNotInitialized;
            e.description = "Store Kit Initilizations required";

            IOSStoreKitRestoreResponce r = new IOSStoreKitRestoreResponce(false, e);
            OnRestoreComplete(r);
            dispatch(RESTORE_TRANSACTION_FAILED, r);
            return;
        }

                #if !UNITY_EDITOR
        IOSNativeMarketBridge.restorePurchases();
                #else
        if (IOSNativeSettings.Instance.SendFakeEventsInEditor)
        {
            foreach (string productId in _productsIds)
            {
                Debug.Log("Restored: " + productId);
                FireProductBoughtEvent(productId, "", "", true);
            }
            FireRestoreCompleteEvent();
        }
                #endif
    }
Exemple #3
0
 private static void OnRestoreComplete(IOSStoreKitRestoreResponce res)
 {
     if (res.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Success", "Restore Compleated");
     }
     else
     {
         IOSNativePopUpManager.showMessage("Error: " + res.error.code, res.error.description);
     }
 }
    public void onRestoreTransactionFailed(string array)
    {
        string[] data;
        data = array.Split("|" [0]);


        IOSStoreKitError e = new IOSStoreKitError();

        e.code        = (IOSTransactionErrorCode)Convert.ToInt32(data[0]);
        e.description = data[1];

        IOSStoreKitRestoreResponce r = new IOSStoreKitRestoreResponce(false, e);


        dispatch(RESTORE_TRANSACTION_FAILED, r);
        OnRestoreComplete(r);
    }
	private static void OnRestoreComplete (IOSStoreKitRestoreResponce res) {
		if(res.IsSucceeded) {
			IOSNativePopUpManager.showMessage("Success", "Restore Compleated");
		} else {
			IOSNativePopUpManager.showMessage("Error: " + res.error.code, res.error.description);
		}
	}