Search Unity

Game integration google admob unity3d plugin

Discussion in 'Formats & External Tools' started by ugameplayer111, Apr 20, 2017.

  1. ugameplayer111

    ugameplayer111

    Joined:
    Apr 20, 2017
    Posts:
    1
    Unity 3d to make the game out, but how to make money? One of them is to load the ad, then the following to teach you how to load ads.
    Step 1: Apply google admob mobile ad id
    We apply for ADMOB advertising account, the website http://apps.admob.com, enter the account, click on the site and application, create your application, click Add website / application, select the application type, we choose IPONE application, of course, android Application is also possible, the interface is the same.

    Load the admob unity 3d ad plugin
    One, through admob unity3d plugin,
    On https://github.com/unity-plugins/Unity-Admob download extension.
    Click the close or download button, or you can use git to download the plugin code
    Or directly under the admob_unity_plugin.unitypackage plugin file
    2. After downloading his admob unity3d plug-in inside the resources to import under their own projects.

    Unity3d app to add Admob bar ads to make money
    Before starting the code, you need to add the Unity 3d admob plugin to the unity3d project.
    Admob.getInstance (). InitAdmob ("bar ad id", "full-screen ad id"); // The ad ID is the registration mentioned above to get it, so set up to initialize Admob, set ID only need to set once, if Behind the show full-screen ads and so no need to set again
    Admob.getInstance (). ShowBannerRelative (AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0); // show the banner, the size of the banner is the standard Banner, the ad position is centered at the bottom

    Admob native ads show money
    Native ads and banner ads are very similar, but you can customize the display of custom ads by css style classes on the server side. The interface is also basically similar to the banner, but you can set the name, in an interface to display multiple banner ads
    Ad nativebannerID is the ad ID, the size of the banner is Admob background custom size, the ad position is the top of the move down 260 (), the new adSize (320,120), AdPosition.BOTTOM_CENTER, 0, nativeBannerID) Pixels

    Unity3d app shows Admob full screen ads to make money
    Full-screen advertising profit ratio banner advertising higher, but also because of the lack of fixed position better control. Unity3d display full-screen advertising is also very convenient. Directly on the code. The code added to the admob event listener, after receiving the full-screen ad has been loaded successfully, it is displayed on the screen.
    Admob.Instance (). InitAdmob ("bar ad id", "full-screen ad id"); // The ad ID is the above mentioned registration to get, so set up to initialize Admob
    Admob.Instance (). InterstitialEventHandler + = onInterstitialEvent;
    Admob.getInstance (). LoadInterstitial (); // show the banner, the size of the banner is the standard Banner, the ad position is the top down 100 pixels
    Void onInterstitialEvent (string eventName, string msg)
    {
    Debug.Log ("handler onAdmobEvent ---" + eventName + "" + msg);
    If (eventName == AdmobEvent.onAdLoaded)
    {
    Admob.Instance (). ShowInterstitial ();
    }
    }

    If you do not want to show your ad when you're done, you can also call it when you need it, check if it is successful, and if it is successful

    If (Admob.getInstance (). IsInterstitialReady ())
    {
    Admob.getInstance (). ShowInterstitial ();
    }
    Unity3d game inside the integration of admob advertising, the application of the game released to the various markets, and other users to download and play your game, the ad is viewed and click, admob the background will be able to see the advertising revenue. The more clicks, the more income.
     
  2. Havan

    Havan

    Joined:
    Jun 3, 2017
    Posts:
    1
    How do I make the admob banner ad appear in a specific position on the screen?