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 }
public void buyProduct(string productId) { #if !UNITY_EDITOR if (!_IsStoreLoaded) { Debug.LogWarning("buyProduct shouldn't be called before store kit initialized"); SendTransactionFailEvent(productId, "Store kit not yet initialized"); return; } else { if (!_IsInAppPurchasesEnabled) { SendTransactionFailEvent(productId, "In App Purchases Disabled"); } } IOSNativeMarketBridge.buyProduct(productId); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { FireProductBoughtEvent(productId, "", false); } #endif }
public void RestorePurchases() { if (!_IsStoreLoaded) { SA.Common.Models.Error e = new SA.Common.Models.Error((int)IOSTransactionErrorCode.SKErrorPaymentServiceNotInitialized, "Store Kit Initilizations required"); IOSStoreKitRestoreResult r = new IOSStoreKitRestoreResult(e); OnRestoreComplete(r); return; } OnRestoreStarted(); #if !UNITY_EDITOR IOSNativeMarketBridge.restorePurchases(); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { foreach (IOSProductTemplate product in Products) { if (product.ProductType == ISN_InAppType.NonConsumable) { ISN_Logger.Log("Restored: " + product.Id); FireProductBoughtEvent(product.Id, "", "", "", true); } } FireRestoreCompleteEvent(); } #endif }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- public void loadStore() { if (_IsWaitingLoadResult || _IsStoreLoaded) { return; } _IsWaitingLoadResult = true; foreach (string pid in IOSNativeSettings.Instance.InAppProducts) { addProductId(pid); } string ids = ""; int len = _productsIds.Count; for (int i = 0; i < len; i++) { if (i != 0) { ids += ","; } ids += _productsIds[i]; } IOSNativeMarketBridge.loadStore(ids); }
public void restorePurchases() { if (!_IsStoreLoaded) { ISN_Error e = new ISN_Error((int)IOSTransactionErrorCode.SKErrorPaymentServiceNotInitialized, "Store Kit Initilizations required"); IOSStoreKitRestoreResult r = new IOSStoreKitRestoreResult(e); OnRestoreComplete(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 }
public void restorePurchases() { if (!_IsStoreLoaded || !_IsInAppPurchasesEnabled) { dispatch(RESTORE_TRANSACTION_FAILED); return; } IOSNativeMarketBridge.restorePurchases(); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- public void loadStore() { if (_IsStoreLoaded) { Invoke("FireSuccsesInitEvent", 1f); return; } if (_IsWaitingLoadResult) { return; } _IsWaitingLoadResult = true; foreach (string pid in IOSNativeSettings.Instance.InAppProducts) { addProductId(pid); } string ids = ""; int len = _productsIds.Count; for (int i = 0; i < len; i++) { if (i != 0) { ids += ","; } ids += _productsIds[i]; } #if !UNITY_EDITOR IOSNativeMarketBridge.loadStore(ids); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { Invoke("FireSuccsesInitEvent", 1f); } #endif }
public void LoadStore(bool forceLoad = false) { if (_IsStoreLoaded) { if (!forceLoad) { Invoke("FireSuccessInitEvent", 1f); return; } } if (_IsWaitingLoadResult) { return; } _IsWaitingLoadResult = true; string ids = ""; int len = Products.Count; for (int i = 0; i < len; i++) { if (i != 0) { ids += ","; } ids += Products[i].Id; } ISN_SoomlaGrow.Init(); #if !UNITY_EDITOR IOSNativeMarketBridge.loadStore(ids); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { Invoke("EditorFakeInitEvent", 1f); } #endif }
public void buyProduct(string productId) { if (!_IsStoreLoaded) { Debug.LogWarning("buyProduct shouldn't be called before store kit initialized"); SendTransactionFailEvent(productId, "Store kit not yet initialized"); return; } else { if (!_IsInAppPurchasesEnabled) { SendTransactionFailEvent(productId, "In App Purchases Disabled"); } } IOSNativeMarketBridge.buyProduct(productId); }
public void restorePurchases() { if (!_IsStoreLoaded || !_IsInAppPurchasesEnabled) { dispatch(RESTORE_TRANSACTION_FAILED); OnRestoreComplete(new ISN_Result(false)); return; } #if !UNITY_EDITOR IOSNativeMarketBridge.restorePurchases(); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { foreach (string productId in _productsIds) { FireProductBoughtEvent(productId, "", true); } FireRestoreCompleteEvent(); } #endif }
public void buyProduct(string productId) { #if !UNITY_EDITOR if (!_IsStoreLoaded) { if (!IOSNativeSettings.Instance.DisablePluginLogs) { Debug.LogWarning("buyProduct shouldn't be called before StoreKit is initialized"); } SendTransactionFailEvent(productId, "StoreKit not yet initialized", IOSTransactionErrorCode.SKErrorPaymentNotAllowed); return; } IOSNativeMarketBridge.buyProduct(productId); #else if (IOSNativeSettings.Instance.SendFakeEventsInEditor) { FireProductBoughtEvent(productId, "", "", false); } #endif }
public void verifyLastPurchase(string url) { IOSNativeMarketBridge.verifyLastPurchase(url); }
public void RequestInAppSettingState() { IOSNativeMarketBridge.ISN_RequestInAppSettingState(); }
public void RequestStorefrontIdentifier() { IOSNativeMarketBridge.CloudService_RequestStorefrontIdentifier(); }
public void RequestCapabilities() { IOSNativeMarketBridge.CloudService_RequestCapabilities(); }
//-------------------------------------- // Public Methods //-------------------------------------- public void RequestAuthorization() { IOSNativeMarketBridge.CloudService_RequestAuthorization(); }