public void Start() { //ca-app-pub-3940256099942544~3347511713 // real //ca-app-pub-8772213531309625~7038483006 #if UNITY_ANDROID string appId = "ca-app-pub-3940256099942544~3347511713"; #elif UNITY_IPHONE string appId = "ca-app-pub-3940256099942544~3347511713"; #else string appId = "ca-app-pub-3940256099942544~3347511713"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.RequestBanner(); }
void Awake() { Instance = this; DontDestroyOnLoad(gameObject); loadCount = 2; isRewarded = false; #if UNITY_EDITOR return; #elif UNITY_ANDROID MobileAds.Initialize(appIdAndroid); #elif UNITY_IOS MobileAds.Initialize(appIdIOs); #else Debug.Log("Unsupported platform") return; #endif //request a banner ///////////////////////////////////////////////////////////////////////////////////////////////////////// //this.RequestBannerAd(); //Request an interstitial ad this.RequestInterstitialAd(); //Request a video ad this.rewardBasedVideo = RewardBasedVideoAd.Instance; // Called when an ad request has successfully loaded. rewardBasedVideo.OnAdLoaded += HandleRewardBasedVideoLoaded; // Called when an ad request failed to load. rewardBasedVideo.OnAdFailedToLoad += HandleRewardBasedVideoFailedToLoad; // Called when an ad is shown. rewardBasedVideo.OnAdOpening += HandleRewardBasedVideoOpened; // Called when the ad starts to play. rewardBasedVideo.OnAdStarted += HandleRewardBasedVideoStarted; // Called when the user should be rewarded for watching a video. rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded; // Called when the ad is closed. rewardBasedVideo.OnAdClosed += HandleRewardBasedVideoClosed; // Called when the ad click caused the user to leave the application. rewardBasedVideo.OnAdLeavingApplication += HandleRewardBasedVideoLeftApplication; this.RequestRewardBasedVideo(); }
private void Start() { //string appId = "ca-app-pub-6915619357801525/5075173068"; string appId = "ca-app-pub-6915619357801525~2134504325"; // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); rewardBasedVideoAd = RewardBasedVideoAd.Instance; rewardBasedVideoAd.OnAdLoaded += RewardBasedVideoAd_OnAdLoaded; rewardBasedVideoAd.OnAdFailedToLoad += RewardBasedVideoAd_OnAdFailedToLoad; rewardBasedVideoAd.OnAdRewarded += RewardBasedVideoAd_OnAdRewarded; rewardBasedVideoAd.OnAdClosed += RewardBasedVideoAd_OnAdClosed; bannerView.OnAdLoaded += BannerView_OnAdLoaded; bannerView.OnAdFailedToLoad += BannerView_OnAdFailedToLoad; RequestRewardBasedVideoAd(); }
// Use this for initialization void Start() { #if UNITY_ANDROID string appID = "ca-app-pub-3681695695299458~4413828827"; #elif UNITY_IPHONE string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE"; #else string adUnitId = "unexpected_platform"; #endif //Request Ads //RequestBanner(); MobileAds.Initialize(appID); RequestInterstitial(); showInterstitialAd(); }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } MobileAds.Initialize(initStatus => { }); //this.RequestBanner(); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); UserDialogs.Init(this); Forms.SetFlags("SwipeView_Experimental"); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); MobileAds.Initialize(ApplicationContext, "ca-app-pub-6807199856579105~3836739510"); LoadApplication(new App()); }
// Use this for initialization void Start() { Application.targetFrameRate = 60; screenHeight = 19.2f; screenWidth = screenHeight * Screen.width / Screen.height; spawnTime = 0; score = 0; best = PlayerPrefs.GetInt("best", 0); txtScore.SetActive(false); txtWave.SetActive(false); transform.position = new Vector3(transform.position.x, CAMERA_POSITION_READY, transform.position.z); Camera.main.orthographicSize = CAMERA_SIZE_READY; cvsMainMenu.SetActive(true); cvsGameplay.SetActive(false); cvsGameOver.SetActive(false); source.clip = sndMainMenu; source.Play(); spawningEnemies = false; spawnCount = 0; currentWave = 0; state = GameState.READY; instance = this; #if UNITY_ANDROID string appId = "ca-app-pub-0081066185741622~1212788759"; #elif UNITY_IPHONE string appId = "ca-app-pub-0081066185741622~2263405726"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestInterstitial(); }
// Use this for initialization void Start() { MobileAds.Initialize(appID); OnClickShowBanner(); RequestInterstitial(); AboutRequestInterstitial(); this.rewardBasedVideo = RewardBasedVideoAd.Instance; //this.toastMaker = new ToastMaker (); rewardBasedVideo.OnAdLoaded += RewardHandleRewardBasedVideoLoaded; rewardBasedVideo.OnAdFailedToLoad += RewardHandleRewardBasedVideoFailedToLoad; rewardBasedVideo.OnAdLeavingApplication += RewardHandleRewardBasedVideoLeftApplication; rewardBasedVideo.OnAdClosed += RewardHandleRewardBasedVideoClosed; this.RequestRewardBasedVideo(); //this.RequestBanner (); }
private void Init() { MobileAds.Initialize(adData.AppID); interstitialReg = new InterstitialAd(adData.InterstitialRegID); interstitialVideo = new InterstitialAd(adData.InterstitialVideoID); interstitialReward = new RewardedAd(adData.InterstitialRewardID); SubscribeAds(); EventManager.Subscribe(Events.ADEvents.SHOW_AD, ShowAD_Handler); EventManager.Subscribe(Events.GameEvents.GAME_STARTED, ResetCurrentInterstitial); EventManager.Subscribe(Events.GameEvents.GAME_ENDED, ResetCurrentInterstitial); LoadInterstitial(interstitialReg); LoadInterstitial(interstitialVideo); LoadInterstitial(interstitialReward); }
// Init void Start() { if (PlayerPrefs.GetInt("removed_ads") == 1) { removedAds = true; } else { removedAds = false; MobileAds.Initialize(initStatus => { }); MobileAds.SetiOSAppPauseOnBackground(true); RequestBanner(); RequestInterstitial(); RequestRewardAd(); } }
private void InitAd() { //string id = Debug.isDebugBuild ? test_unitId : unitId; string id = unitId; //string id = test_unitId; MobileAds.Initialize(id); banner = new BannerView(id, AdSize.Banner, position); //AdRequest request = new AdRequest.Builder().AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice(test_deviceId).Build(); AdRequest request = new AdRequest.Builder().Build(); banner.LoadAd(request); ToggleAd(activeBanner); //banner.Show(); }
public void Start() { #if UNITY_ANDROID // string appId = "ca-app-pub-3940256099942544~3347511713"; string appId = "ca-app-pub-8545434136440180~6773120624"; #elif UNITY_IPHONE string appId = "ca-app-pub-3940256099942544~1458002511"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.CreateAndLoadRewardedAd(); }
public void Start() { string appId; if (isRealAdds) { appId = "ca-app-pub-2945346553316838~1653570636";//box run 3d } else { appId = "ca-app-pub-3940256099942544~3347511713";//test appId } // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.RequestBanner(); this.RequestInter(); }
//[SerializeField] Text TxtPoints; void Start() { //BtnInterstitial.interactable = false; idApp = "ca-app-pub-4769109696867378~6434824569"; idBanner = "ca-app-pub-4769109696867378/3319359029"; //ca-app-pub-4769109696867378~6434824569 //idInterstitial = "ca-app-pub-3940256099942544/1033173712";//ca-app-pub-4769109696867378~6434824569 idReward = "ca-app-pub-4769109696867378/3829552962"; //ca-app-pub-4769109696867378~6434824569 adReward = RewardBasedVideoAd.Instance; MobileAds.Initialize(idApp); RequestBannerAd(); //RequestInterstitialAd(); //points = PlayerPrefs.GetInt("S"); }
public void Start() { #if UNITY_ANDROID string appId = "ca-app-pub-7855200918488357~9058694966"; #elif UNITY_IPHONE string appId = "ca-app-pub-7855200918488357~9058694966"; #else string appId = "ca-app-pub-7855200918488357~9058694966"; #endif Advertisement.Initialize("2780603", false); // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.RequestBanner(); }
public override void OnEnter() { base.OnEnter(); if (AdMobInitialize.Instance.IsAdMobInitialized) { Finish(); } else { MobileAds.Initialize(initStatus => { Debug.Log(initStatus); // 何が正常終了化わからん AdMobInitialize.Instance.AdMobInitialized(true); Finish(); }); } }
private void RequestRewardBasedVideo() { #if UNITY_ANDROID string appId = "ca-app-pub-1598053448886416~7618735531"; #elif UNITY_IPHONE string appId = "ca-app-pub-1598053448886416~7618735531"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); // Get singleton reward based video ad reference. this.rewardBasedVideo = RewardBasedVideoAd.Instance; cargarRewardedVideo(); }
// Start is called before the first frame update void Start() { // show = false; // Debug.Log("Unity Ads test mode enabled: " + Advertisement.testMode); MobileAds.Initialize(gameID); this.RequestBanner(); // Advertisement.Initialize(gameID, false); // Debug.Log("Unity Ads initialized: " + Advertisement.isInitialized); // Debug.Log("Unity Ads is supported: " + Advertisement.isSupported); // Debug.Log("Unity Ads is showing: " + Advertisement.isShowing); // StartCoroutine(ShowBannerWhenReady()); player.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition; inMenuUI.gameObject.SetActive(true); inGameUI.gameObject.SetActive(false); gameOverUI.gameObject.SetActive(false); // Debug.Log("Unity Ads is showing: " + Advertisement.isShowing); }
/// <summary> /// Inizialise app for ad before load ads (like banner). /// only once on load application. /// </summary> public void InitialiseAds() { // For ad before load ad #if UNITY_ANDROID && !UNITY_EDITOR string appId = "c"; #elif UNITY_IPHONE && !UNITY_EDITOR string appId = "unexpected_platform"; #elif UNITY_EDITOR // Do nothing. string appId = "unexpected_platform"; #else string appId = "unexpected_platform"; Debug.LogError("unexpected_platform"); #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); }
public void Initialize() { if (!AllInOneMobileSettings.Instance.useAdMob) { Debug.LogError("Ads are disabled."); return; } if (initialized) { return; } MobileAds.Initialize(initStatus => { }); InitializeBanner(); InitializeInterstitial(); InitializeRewarded(); initialized = true; }
// Use this for initialization void Awake() { if (Ins == null) { Ins = this; DontDestroyOnLoad(this); } else { Destroy(this); } MobileAds.Initialize("ca-app-pub-3940256099942544~3347511713"); this.interstitial = new InterstitialAd("ca-app-pub-1589360682424634/9091081337"); this.rewardBasedVideo = RewardBasedVideoAd.Instance; rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded; this.VideoRequest(); AdRequest(); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); //AppCenter.Start("e37f922b-1460-41e1-9bcd-fd4c622ab8a6", typeof(Analytics), typeof(Crashes)); MobileAds.Initialize(ApplicationContext, "ca-app-pub-8844105249330187~4536497303"); Push.SetSenderId("586898794466"); LoadApplication(new App()); }
// Start is called before the first frame update void Start() { //PlayerPrefs.DeleteAll(); if (Ad_Manager != null) { Destroy(this.gameObject); } Ad_Manager = this.gameObject; MobileAds.Initialize(APP_ID); //RequestBanner(); RequestInterstitial(); RequestVideoAD(); DontDestroyOnLoad(Ad_Manager); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Xamarin.Essentials.Platform.Init(this, bundle); // add this line to your code, it may also be called: bundle global::Xamarin.Forms.Forms.Init(this, bundle); FormsMaterial.Init(this, bundle); CardsViewRenderer.Preserve(); ImageCircleRenderer.Init(); MobileAds.Initialize(ApplicationContext, "ca-app-pub-8359860011604747~6496691983"); Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle); LoadApplication(new App()); }
void Awake() { try{ #if UNITY_ANDROID string appId = "ca-app-pub-5538586303013353~5140709220"; #elif UNITY_IPHONE string appId = "ca-app-pub-3940256099942544~1458002511"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); } catch { Camera.main.backgroundColor = Color.red; } }
// Use this for initialization void Start() { string ID = "ca-app-pub-3614489525260801~6559714706"; #if UNITY_ANDROID string appId = ID; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); if (nums == 1) { RequestInterstitial(); } }
// Start is called before the first frame update void Start() { // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(initStatus => { }); #if UNITY_ANDROID string appId = "ca-app-pub-3940256099942544~3347511713"; #elif UNITY_IPHONE string appId = "ca-app-pub-3940256099942544~1458002511"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.RequestBanner(); }
// Start is called before the first frame update void Start() { #if UNITY_ANDROID string appId = "ca-app-pub-2432741135954738~3887430119"; //your admob app id #elif UNITY_IPHONE string appId = "ca-app-pub-3940256099942544~1458002511"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestRewardedAd(); RequestInterstitial(); RequestBanner(); ShowBanner(); }
void Start() { MobileAds.Initialize(AppID); interstitialAd = new InterstitialAd(InterstitialAdUnitID); interstitialAd.LoadAd(new AdRequest.Builder().Build()); // Called when an ad request has successfully loaded. this.interstitialAd.OnAdLoaded += HandleOnAdLoaded; // Called when an ad request failed to load. this.interstitialAd.OnAdFailedToLoad += HandleOnAdFailedToLoad; // Called when an ad is shown. this.interstitialAd.OnAdOpening += HandleOnAdOpened; // Called when the ad is closed. this.interstitialAd.OnAdClosed += HandleOnAdClosed; // Called when the ad click caused the user to leave the application. this.interstitialAd.OnAdLeavingApplication += HandleOnAdLeavingApplication; }
void Start() { MobileAds.Initialize(appID); OnClickShowBanner(); bannerView.Clear(); FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { dependencyStatus = task.Result; if (dependencyStatus == DependencyStatus.Available) { InitializeFirebase(); } else { Debug.LogError( "Could not resolve all Firebase dependencies: " + dependencyStatus); } }); }