void Start()
 {
     revmob = RevMob.Start(appIds, "GameObject");
     if (banner == null)
     {
         banner = revmob.CreateBanner();
     }
     banner.Show();
 }
예제 #2
0
        private async Task ShowBanner()
        {
            try
            {
                bannerLayout.Visibility = ViewStates.Visible;

                if (revmobBanner != null)
                {
                    revmobBanner.Show();
                    return;
                }

                var revMob = await RevMobHelper.TryGetAdMobSessionAsync(startSessionListener);

                if (revMob == null)
                {
                    HideBanner();
                    return;
                }

                revmobBanner = revMob.CreateBanner(this, "", showBannerAdListener);
                revmobBanner.SetAutoShow(true);

                ViewGroup view = FindViewById <ViewGroup>(Resource.Id.webViewContainer_banner);

                view.RemoveAllViews();
                view.AddView(revmobBanner);
            }
            catch { }
        }
예제 #3
0
 void Start()
 {
             #if UNITY_ANDROID || UNITY_IPHONE
     RevMobBanner banner = revmob.CreateBanner(RevMob.Position.BOTTOM, 0, 0, Screen.width, (int)Screen.width / 7);
     banner.Show();
             #endif
 }
예제 #4
0
 public override bool?showBanner()
 {
     //Debug.Log("show revmob");
     try
     {
         if (Info.IsEditor() || (firstTime && !Setup()))
         {
             //Debug.Log("show return revmob");
             return(false);
         }
                     #if UNITY_IPHONE
         if (banner == null)
         {
             //Debug.Log("show return 2 revmob");
             return(false);
         }
         banner.Show();
         return(true);
                     #else
         return(false);
                     #endif
     }
     catch
     {
         return(Error(API, ERROR_TRY_SHOW_BANNER));
     }
 }
예제 #5
0
 public static void showRevMobBannerAd()
 {
     if (SSAdInitializer.RevMobActiveStaticFlag)
     {
         RevMobBanner banner = SSAdInitializer.revMobSession.CreateBanner();
         banner.Show();
     }
 }
    void OnGUI()
    {
        if (GUILayout.Button("Start Session"))
        {
                        #if !UNITY_EDITOR
            revmob = RevMob.Start(REVMOB_APP_IDS, gameObject.name);
                        #endif
        }
        if (GUILayout.Button("Create Intertitial"))
        {
                        #if !UNITY_EDITOR
            fullscreen = revmob.CreateFullscreen();
                        #endif
        }
        if (GUILayout.Button("Display Interstitial"))
        {
                        #if !UNITY_EDITOR
            if (fullscreen == null)
            {
                fullscreen = revmob.CreateFullscreen();
            }

            fullscreen.Show();
                        #endif
        }
        if (GUILayout.Button("Create Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner = revmob.CreateBanner();
                        #endif
        }
        if (GUILayout.Button("Show Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner.Show();
                        #endif
        }
        if (GUILayout.Button("Hide Banner"))
        {
                        #if !UNITY_EDITOR
            loadedBanner.Hide();
                        #endif
        }
    }
예제 #7
0
    IEnumerator delay()
    {
        Debug.Log("Called");
        yield return(new WaitForSeconds(0.2f));

        if (!banner.loaded && !showRev && tried)
        {
            ban.Show();
            Debug.Log("Did again");
            //banner = null;
            showRev = true;
        }
        Debug.Log("Waited 0.2");
        yield return(new WaitForSeconds(4.8f));

        banner.visible = false;
        if (tried)
        {
            ban.Hide();
            unload();
        }
        Debug.Log("Loading Level");
        loadLevel();
    }
예제 #8
0
    void CreateBannerButtons()
    {
        i++;
        if( GUI.Button(new Rect(X_POSITION_REFERENCE, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Show Banner") ) {
        #if UNITY_ANDROID || UNITY_IPHONE
            if (banner == null) {
                banner = revmob.CreateBanner();
            }
            banner.Show();
        #endif
            return;
        }
        i++;
        if ( GUI.Button(new Rect(X_POSITION_REFERENCE, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Custom Banner") ) {
        #if UNITY_ANDROID
            banner = revmob.CreateBanner(RevMob.Position.TOP, 0, 0, Screen.width, 55);
            banner.Show();
        #elif UNITY_IPHONE
            banner = revmob.CreateBanner(10, 20, 200, 40, null, null);
            banner.Show();
        #endif
            return;
        }

        if (banner != null)
        {
            if ( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Hide Banner") ) {
            #if UNITY_ANDROID || UNITY_IPHONE
                banner.Hide();
            #endif
                return;
            }
        }

        if (banner != null)
        {
            if ( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, (i+1) * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Deactivate Banner") ) {
            #if UNITY_ANDROID || UNITY_IPHONE
                banner.Release();
                banner = null;
            #endif
                return;
            }
        }
    }
예제 #9
0
	public static void ShowBanner(RevMob.Position position)
	{
		#if UNITY_ANDROID || UNITY_IPHONE
		if(!bannerShowed)
		{
			banner = revmob.CreateBanner (position);
			banner.Show ();
			bannerShowed = true;
		}
		#endif
	}