public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // Or ... a non-consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); PlayerPrefs.SetInt("RemoveAds", 1); #if UNITY_ANDROID AndroidNativePlugin.ShowToastMessage("Ads have been permanently removed", ToastTimeLength.Long); #endif } else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating wither this product has completely been received, or if the application needs to be reminded of this purchase at next app launch. Is useful when saving purchased products to the cloud, and when that save is delayed. return(PurchaseProcessingResult.Complete); }
public void showRewardedVideo() { if (rewardBasedVideo.IsLoaded()) { rewardBasedVideo.Show(); } else { if (!AndroidNativePlugin.IsInternetConnected() && !AndroidNativePlugin.IsWifiConnected() && !AndroidNativePlugin.IsMobileConnected()) { GameManager.Instance.setGameState(GameState.States.InternetNotConnected); } else { GameManager.Instance.setGameState(GameState.States.AdNotAvaiableState); } RequestRewardedVideo(); } }
public void onFreeCoinsBtnClick() { if (Application.platform.Equals(RuntimePlatform.Android)) { if (AndroidNativePlugin.IsInternetConnected() || AndroidNativePlugin.IsWifiConnected() || AndroidNativePlugin.IsMobileConnected()) { GameManager.Instance.setGameState(GameState.States.VideoAdConfirmation); GameManager.Instance.soundState.playSound(SoundController.States.BTNCLICKSOUND); } else { GameManager.Instance.setGameState(GameState.States.InternetNotConnected); GameManager.Instance.soundState.playSound(SoundController.States.BTNCLICKSOUND); } } else { GameManager.Instance.setGameState(GameState.States.VideoAdConfirmation); GameManager.Instance.soundState.playSound(SoundController.States.BTNCLICKSOUND); } }
public void OnClick_OpenSettings() { AndroidNativePlugin.OpenSettings(); }
public void OnClick_Vibrate2() { AndroidNativePlugin.Vibrate2(); }
public void OnClick_Flashlight() { AndroidNativePlugin.Flashlight(); }
public void OnClick_OpenCamera() { AndroidNativePlugin.OpenCamera(); }
public void OnClick_OpenGallery() { AndroidNativePlugin.OpenGallery(); }