void Update() { // dispBannerがTRUEになったら表示 if (!GameSystemManager.dispBanner || dispd) { return; } dispd = true; // アプリIDを設定 #if UNITY_ANDROID string appId = GameUtil.Const.ADMOB_ANDROID_APP_ID; #elif UNITY_IPHONE string appId = GameUtil.Const.ADMOB_IOS_APP_ID; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestBanner(); }
public new void Awake() { if (Application.identifier != packageName) { Debug.LogErrorFormat("GoogleAdmobModel can't be initialized: Wrong packageName(are u missed to update AppId and Ads Ids?)\n" + "; Wrong:{0}, Correct:{1}", packageName, Application.identifier); return; } Action <InitializationStatus> status = null; MobileAds.Initialize(status); base.Awake(); _admob = Admob.Instance(); // ShowBanner(null, new Vector2(0, 500)); Debug.Log("GoogleAdmobModel initialized."); Admob.AdmobEventHandler rewardVideoEventsHandler = new Admob.AdmobEventHandler(OnRewardVideoEvent); _admob.rewardedVideoEventHandler += rewardVideoEventsHandler; Admob.AdmobEventHandler interEventsHandler = new Admob.AdmobEventHandler(OnInterstitialEvent); _admob.interstitialEventHandler += interEventsHandler; }
public void Start() { if (instancia == null) { instancia = this; } #if UNITY_ANDROID string appId = "ca-app-pub-1343647000894788~1193651346"; #elif UNITY_IPHONE string appId = "ca-app-pub-1343647000894788~1193651346"; #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; this.RequestBanner(); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { Window = new UIWindow(UIScreen.MainScreen.Bounds); // Override point for customization after application launch. // If not required for your application you can safely delete this method // Code to start the Xamarin Test Cloud Agent #if ENABLE_TEST_CLOUD //Xamarin.Calabash.Start(); #endif ServiceLocator.Instance.Add <IS3Service, S3Service>(); ServiceLocator.Instance.Add <IImageDownloader, ImageDownloader>(); ServiceLocator.Instance.Add <IPersistantStorage, PersistantStorage>(); ServiceLocator.Instance.Add <IBroadcastNotificaion, BroadCastNotificaion>(); Profile.EnableUpdatesOnAccessTokenChange(true); Settings.AppID = NotSensitive.SlinkKeys.facebook_app_id; Settings.DisplayName = NotSensitive.SlinkKeys.facebook_display_name; if (RealmUserServices.DidUserPersist()) { ApplicationExtensions.EnterApplication(false, true); } else { ApplicationExtensions.LoadStoryboardRoot("Landing", false); } SetupUnauthorizedCatcher(); PredownloadImages(); AppCenter.Start("fa06eb43-8be9-426c-97f9-42f3ab13cd3b", typeof(Analytics), typeof(Crashes)); ServiceRunner.SharedInstance.StartService <AppCenterManager>(); MobileAds.Configure("ca-app-pub-4252799872870196~2848379026"); return(true); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Forms.SetFlags("SwipeView_Experimental"); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); // Test: MobileAds.Initialize(this, " ca-app-pub-3940256099942544~3347511713"); DIPS.Xamarin.UI.Android.Library.Initialize(); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true); Rg.Plugins.Popup.Popup.Init(this); MobileAds.Initialize(this, "ca-app-pub-1387996564780038~2222145561"); string dbname = "gamers_db.sqlite"; string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); string fullPath = Path.Combine(folderPath, dbname); LoadApplication(new App(fullPath)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); CarouselViewRenderer.Init(); FlowListView.Init(); CachedImageRenderer.Init(); //赋值数据库文件 FileAccessHelper.GetLocalFilePath("Data.sqlite"); LoadApplication(new App()); //var x = typeof(Xamarin.Forms.Themes.DarkThemeResources); //x = typeof(Xamarin.Forms.Themes.LightThemeResources); //x = typeof(Xamarin.Forms.Themes.iOS.UnderlineEffect); //initialize MobileAds MobileAds.Configure("ca-app-pub-XXXXXXXXXXXXXX"); return(base.FinishedLaunching(app, options)); }
public void Start() { if (PlayerPrefs.GetInt("Ads Removed") == 0) { MobileAds.Initialize(appId); //Request Ads RequestBanner(); RequestInterstitial(); } else { return; } // Get singleton reward based video ad reference. this.rewardBasedVideo = RewardBasedVideoAd.Instance; // Called when the user should be rewarded for watching a video. rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded; RequestRewardedVideo(); }
// Use this for initialization void Start() { game = GameManager.Instance; #if UNITY_ANDROID string appId = "ca-app-pub-3698875051105618~6819407412"; #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); obj = new GameManager(); this.RequestBanner(); this.RequestInterstitial(); this.rewardBasedVideo = RewardBasedVideoAd.Instance; this.RequestRewardBasedVideo(); }
// Start is called before the first frame update void Start() { MobileAds.Initialize(initStatus => { }); rewardedAd = new RewardedAd(rewardedVideoAd); // Called when an ad request has successfully loaded. rewardedAd.OnAdLoaded += HandleRewardedAdLoaded; // Called when an ad request failed to load. rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad; // Called when an ad is shown. rewardedAd.OnAdOpening += HandleRewardedAdOpening; // Called when an ad request failed to show. rewardedAd.OnAdFailedToShow += HandleRewardedAdFailedToShow; // Called when the user should be rewarded for interacting with the ad. rewardedAd.OnUserEarnedReward += HandleUserEarnedReward; // Called when the ad is closed. rewardedAd.OnAdClosed += HandleRewardedAdClosed; AdRequest requestRewardVideoAd = new AdRequest.Builder().Build(); rewardedAd.LoadAd(requestRewardVideoAd); }
void Start() { MobileAds.Initialize(appId); ad = RewardBasedVideoAd.Instance; //광고요청이 성공적으로 로드되면 호출됩니다. ad.OnAdLoaded += OnAdLoaded; //광고요청을 로드하지 못했을 때 호출됩니다. ad.OnAdFailedToLoad += OnAdFailedToLoad; //광고가 표시될 때 호출됩니다. ad.OnAdOpening += OnAdOpening; //광고가 재생되기 시작하면 호출됩니다. ad.OnAdStarted += OnAdStarted; //사용자가 비디오 시청을 통해 보상을 받을 때 호출됩니다. ad.OnAdRewarded += OnAdRewarded; //광고가 닫힐 때 호출됩니다. ad.OnAdClosed += OnAdClosed; //광고클릭으로 인해 사용자가 애플리케이션을 종료한 경우 호출됩니다. ad.OnAdLeavingApplication += OnAdLeavingApplication; LoadAd(); }
private void Initialization() { AllLevels = new Dictionary<string, LevelAsset>(); AllSaves = new Dictionary<string, LevelAsset>(); // Initialize the Google Mobile Ads SDK. #if UNITY_ANDROID string appId = "ca-app-pub-7959728254107074~3791366270"; #elif UNITY_IOS string appId = "ca-app-pub-7959728254107074~6556473878"; #else string appId = "unexpected_platform"; #endif MobileAds.Initialize(appId); interstitialAdCDRunning = false; LoadLevelData(); LoadSaveData(); LoadLoveLevels(); LoadSortData(); HallScene.DispatchRenderLevels(); }
public void InitializeAdmob() { if (isInitialized) { return; } if (StaticVariables.DestroyAd) { isInitialized = true; return; } MobileAds.Initialize(appID); InitializeBannerView(); InitializeInterstitialAd(); isInitialized = true; Debug.Log($"admob 초기화 결과 : {isInitialized}"); }
void Start() { if (instance) { Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); instance = this; if (Advertisement.isSupported) { // Unity ad Advertisement.Initialize(googlePlayId, true); } #if UNITY_ANDROID MobileAds.Initialize(androidAppId); #endif StartBannerAd(); StartInterstitialAd(); } }
public void Start() { modulesList = new List <AdsModule>(); switch (Application.platform) { case RuntimePlatform.Android: AndroidBlocks.ForEach(x => modulesList.Add(new AdsModule(x))); MobileAds.Initialize(AndroidAppID); break; case RuntimePlatform.IPhonePlayer: IOSBlocks.ForEach(x => modulesList.Add(new AdsModule(x))); MobileAds.Initialize(IosAppID); break; } foreach (AdsModule module in modulesList) { module.LoadAd(() => { }); } }
// Start is called before the first frame update public void Start() { // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(initStatus => { }); // iOS / Android ともに Version を取得 //ver1 = Application.unityVersion; Version.GetComponent <Text>().text = "Version " + ver1; // iOS では Build を取得(未確認) // Android では Bundle Version Code を取得 /*Application.unityVersion * string ver2 = UniVersionManager.GetBuildVersion(); * * // 最新版が存在する場合 * if (UniVersionManager.IsNewVersion(NowVersion)) * { * // ここでストアに遷移させたりする * SceneManager.LoadScene("Go_PlayStore"); * } */ StartCoroutine(GetText()); }
void Start() { //anim = GetComponent<Animator>(); goalManager = FindObjectOfType <GoalManager>(); soundManager = FindObjectOfType <SoundManager>(); scoreManager = FindObjectOfType <ScoreManager>(); breakableTiles = new BackgroundTile[width, height]; lockTiles = new BackgroundTile[width, height]; concreteTiles = new BackgroundTile[width, height]; slimeTiles = new BackgroundTile[width, height]; findMatches = FindObjectOfType <FindMatches>(); blankSpaces = new bool[width, height]; allCircle = new GameObject[width, height]; SetUp(); currentState = GameState.pause; //реклама MobileAds.Initialize(AppID); bannerView = new BannerView(BannerAdUnitID, AdSize.Banner, AdPosition.Bottom); bannerView.LoadAd(new AdRequest.Builder().Build()); }
// Start is called before the first frame update void Start() { if (publishingApp) { #if UNITY_ANDROID string appId = "ca-app-pub-1339385848497432~874091076"; #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); } //REQUEST VIDEO this.RequestRewardBasedVideo(); RequestInterstitial(); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (!SceneLoaded) { SceneLoaded = true; MobileAds.Initialize(initStatus => { }); RequestConfiguration childConfig = new RequestConfiguration.Builder().SetTagForChildDirectedTreatment(TagForChildDirectedTreatment.True).build(); MobileAds.SetRequestConfiguration(childConfig); RequestConfiguration contentConfig = new RequestConfiguration.Builder().SetMaxAdContentRating(MaxAdContentRating.G).build(); MobileAds.SetRequestConfiguration(contentConfig); RequestFullScreenAd(); SetupRewardedAds(); if (scene.buildIndex == 0) { RequestBanner(); } SceneLoaded = false; } }
public static void Init(Context context, string appId, string interstitialId = null, string bannerId = null) { m_appId = appId; m_interstitialId = interstitialId; m_bannerId = bannerId; MobileAds.Initialize(context, m_appId); //adRequestBuilder.AddTestDevice(AdRequest.DeviceIdEmulator); //adRequestBuilder.AddTestDevice(m_testDevice); if (!string.IsNullOrWhiteSpace(interstitialId)) { m_interstitialAd = new InterstitialAd(context); m_interstitialAd.AdUnitId = interstitialId; m_interstitialAd.AdListener = new AdListener(); RequestNewInterstitial(); } }
// Use this for initialization void Start() { #if UNITY_ANDROID string appId = "ca-app-pub-6234576313597738~6365458995"; string adUnitId = "ca-app-pub-6234576313597738/4766448627"; #elif UNITY_IOS string appId = ""; string adUnitId = ""; #endif MobileAds.Initialize(appId); this.interstitial = new InterstitialAd(adUnitId); AdRequest request = new AdRequest.Builder().Build(); this.interstitial.LoadAd(request); this.interstitial.OnAdClosed += setAdClosed; Screen.orientation = ScreenOrientation.Portrait; Application.targetFrameRate = 60; GameObject HighScoreO = GameObject.Find("HighScoreText"); Text HighScore = HighScoreO.GetComponent <Text> (); HighScore.text = "High Score: " + PlayerPrefs.GetFloat("AnimalHighScore").ToString(); }
// Use this for initialization private void Awake() { if (instance != null) { RequestInterstitial(); RequestRewardBasedVideo(); } else { #if UNITY_ANDROID string appId = "ca-app-pub-3004677166037107~8018378409"; #endif PlayerPrefs.SetInt("adTime", 1); // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestInterstitial(); RequestRewardBasedVideo(); MakeInstance(); } }
public void Start() { if (reklamKontrol == null) { DontDestroyOnLoad(gameObject); reklamKontrol = this; #if UNITY_ANDROID string appId = "--------------------"; #elif UNITY_IPHONE string appId = "--------------"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); #if UNITY_ANDROID string adUnitId = "-----------------"; #elif UNITY_IPHONE string adUnitId = "--------------"; #else string adUnitId = "unexpected_platform"; #endif interstitial = new InterstitialAd(adUnitId); AdRequest request = new AdRequest.Builder() /*.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice("2077ef9a63d2b398840261c8221a0c9b")*/.Build(); interstitial.LoadAd(request); } else { Destroy(gameObject); } }
void Update() { // dispBannerがTRUEになったら表示 if (!GameSystemManager.dispBanner || dispd) { return; } dispd = true; // アプリIDを設定 #if UNITY_ANDROID string appId = "【広告AppID(Android)】"; #elif UNITY_IPHONE string appId = "【広告AppID(iOS)】"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestBanner(); }
// Start is called before the first frame update void Awake() { ShowABtn.onClick.AddListener(() => ShowABtnHandler()); //ShowABtn.gameObject.SetActive(false); #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); // Get singleton reward based video ad reference. 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(); //UserOptToWatchAd(); }
// ... other code here... public void Start() { // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(initStatus => { }); ldrButton = GameObject.Find("StartButton_LB"); GameObject startButton = GameObject.Find("StartButton_LogIn"); EventSystem.current.firstSelectedGameObject = startButton; // ADD THIS CODE BETWEEN THESE COMMENTS // Create client configuration PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .Build(); // Enable debugging output (recommended) PlayGamesPlatform.DebugLogEnabled = true; // Initialize and activate the platform PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); // END THE CODE TO PASTE INTO START // ADD THESE LINES // Get object instances signInButtonText = GameObject.Find("StartButton_LogIn").GetComponentInChildren <Text>(); authStatus = GameObject.Find("authStatus").GetComponent <Text>(); // ... // PASTE THESE LINES AT THE END OF Start() // Try silent sign-in (second parameter is isSilent) PlayGamesPlatform.Instance.Authenticate(SignInCallback, true); }
public void Start() { if (SceneManager.GetActiveScene().buildIndex == 0) { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } } string appId = "ca-app-pub-8685854447544440~2926976393"; // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); RequestBanner(); rewardVideoAD = RewardBasedVideoAd.Instance; // Called when an ad request has successfully loaded. rewardVideoAD.OnAdLoaded += HandleRewardBasedVideoLoaded; // Called when an ad request failed to load. rewardVideoAD.OnAdFailedToLoad += HandleRewardBasedVideoFailedToLoad; // Called when an ad is shown. rewardVideoAD.OnAdOpening += HandleRewardBasedVideoOpened; // Called when the ad starts to play. rewardVideoAD.OnAdStarted += HandleRewardBasedVideoStarted; // Called when the user should be rewarded for watching a video. rewardVideoAD.OnAdRewarded += HandleRewardBasedVideoRewarded; // Called when the ad is closed. rewardVideoAD.OnAdClosed += HandleRewardBasedVideoClosed; // Called when the ad click caused the user to leave the application. rewardVideoAD.OnAdLeavingApplication += HandleRewardBasedVideoLeftApplication; Display_Banner(); RequestInt(); RequestReward(); }
protected override void OnCreate(Bundle bundle) { InitCrashlytics(); TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; Current = this; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); var builder = new ContainerBuilder(); builder.RegisterInstance(new InternalStorage()) .As <IInternalStorage> (); builder.RegisterType <CodeStorageManager> ().InstancePerLifetimeScope(); builder.RegisterType <CodeManager> ().InstancePerLifetimeScope(); builder.RegisterType <RefreshManager> ().InstancePerLifetimeScope(); builder.RegisterInstance(new ResourceManager()) .As <IResourceManager> (); builder.RegisterInstance(new InAppPurchase()) .As <IInAppPurchase> (); builder.RegisterInstance(new TimerInstance()) .As <ITimerInstance> (); var container = builder.Build(); Vibrator = (Vibrator)GetSystemService(Context.VibratorService); ServiceLocator.SetLocatorProvider(() => new AutofacServiceLocator(container)); MobileAds.Initialize(ApplicationContext, "ca-app-pub-9132934287753769~2766954331"); _iInAppPurchase = ServiceLocator.Current.GetInstance <IInAppPurchase> () as InAppPurchase; LoadApplication(new App()); }
void Start() { //adUnitId - the AdMob ad unit ID from which the BannerView should load ads. //adSize - the AdMob ad size you'd like to use //AdPosition - the position of the banner this.RequestBanner(); // detta är mina unika app-id's som getts på AdMob - en för android en för iOS #if UNITY_ANDROID string appId = "ca-app-pub-3496704489635599~6744683001"; #elif UNITY_IPHONE string appId = "ca-app-pub-3496704489635599~1979441488"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); }
// Use this for initialization private void Initialize() { DisableAllVideoButtons(); #if UNITY_ANDROID appId = GetID(TypeOfPlatform.Android, TypeOfID.App); #elif UNITY_IPHONE appId = GetID(TypeOfPlatform.iOS, TypeOfID.App); #else appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); //Banner RequestBannerAd(); RequestInterstitialAd(); RequestRewardAd(); isInitialized = true; }
public void Start() { DontDestroyOnLoad(gameObject); MobileAds.SetiOSAppPauseOnBackground(true); // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(AppID); // Get singleton reward based video ad reference. this.rewardBasedVideo = RewardBasedVideoAd.Instance; // RewardBasedVideoAd is a singleton, so handlers should only be registered once. this.rewardBasedVideo.OnAdLoaded += this.HandleRewardBasedVideoLoaded; this.rewardBasedVideo.OnAdFailedToLoad += this.HandleRewardBasedVideoFailedToLoad; this.rewardBasedVideo.OnAdOpening += this.HandleRewardBasedVideoOpened; this.rewardBasedVideo.OnAdStarted += this.HandleRewardBasedVideoStarted; this.rewardBasedVideo.OnAdRewarded += this.HandleRewardBasedVideoRewarded; this.rewardBasedVideo.OnAdClosed += this.HandleRewardBasedVideoClosed; this.rewardBasedVideo.OnAdLeavingApplication += this.HandleRewardBasedVideoLeftApplication; RequestInterstitial(); RequestBanner(); }