//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style); StartY+= YLableStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy")) { PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy2")) { PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purshases")) { IOSInAppPurchaseManager.instance.restorePurchases(); } StartX = XStartPos; StartY+= YButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verifay Last Purshase")) { IOSInAppPurchaseManager.instance.verifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View")) { IOSStoreProductView view = new IOSStoreProductView("333700869"); view.Load(); } }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy")) { PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy2")) { PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purshases")) { IOSInAppPurchaseManager.instance.restorePurchases(); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verifay Last Purshase")) { IOSInAppPurchaseManager.instance.verifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View")) { IOSStoreProductView view = new IOSStoreProductView("333700869"); view.Load(); } }
public void RegisterProductView(IOSStoreProductView view) { view.SetId(nextId); _productsView.Add(view.id, view); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Init")) { PaymentManagerExample.init(); } if (IOSInAppPurchaseManager.Instance.IsStoreLoaded) { GUI.enabled = true; } else { GUI.enabled = false; } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #1")) { PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #2")) { PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purchases")) { IOSInAppPurchaseManager.Instance.restorePurchases(); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verify Last Purchases")) { IOSInAppPurchaseManager.Instance.VerifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View")) { IOSStoreProductView view = new IOSStoreProductView("333700869"); view.Disnissed += StoreProductViewDisnissed; view.Load(); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Is Payments Enabled On device")) { IOSInAppPurchaseManager.Instance.OnPurchasesStateSettingsLoaded += OnPurchasesStateSettingsLoaded; IOSInAppPurchaseManager.Instance.RequestInAppSettingState(); } StartX = XStartPos; StartY += YButtonStep; StartY += YLableStep; GUI.enabled = true; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Local Receipt Validation", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth + 10, buttonHeight), "Load Receipt")) { ISN_Security.OnReceiptLoaded += OnReceiptLoaded; ISN_Security.Instance.RetrieveLocalReceipt(); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Retrive Device GUID")) { ISN_Security.OnGUIDLoaded += OnGUIDLoaded; ISN_Security.Instance.RetrieveDeviceGUID(); } }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style); StartY+= YLableStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Init")) { PaymentManagerExample.init(); } if(IOSInAppPurchaseManager.Instance.IsStoreLoaded) { GUI.enabled = true; } else { GUI.enabled = false; } StartX = XStartPos; StartY+= YButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #1")) { PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #2")) { PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purchases")) { IOSInAppPurchaseManager.Instance.RestorePurchases(); } StartX = XStartPos; StartY+= YButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verify Last Purchases")) { IOSInAppPurchaseManager.Instance.VerifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View")) { IOSStoreProductView view = new IOSStoreProductView("333700869"); view.Dismissed += StoreProductViewDisnissed; view.Load(); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Is Payments Enabled On device")) { IOSNativePopUpManager.showMessage("Payments Settings State", "Is Payments Enabled: " + IOSInAppPurchaseManager.Instance.IsInAppPurchasesEnabled); } StartX = XStartPos; StartY+= YButtonStep; StartY+= YLableStep; GUI.enabled = true; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Local Receipt Validation", style); StartY+= YLableStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth + 10, buttonHeight), "Load Receipt")) { ISN_Security.OnReceiptLoaded += OnReceiptLoaded; ISN_Security.Instance.RetrieveLocalReceipt(); } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Retrive Device GUID")) { ISN_Security.OnGUIDLoaded += OnGUIDLoaded; ISN_Security.Instance.RetrieveDeviceGUID(); } }