Ejemplo n.º 1
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Start()
    {
        //Required
        GoogleMobileAd.Init();


        //Optional, add data for better ad targeting
        GoogleMobileAd.SetGender(GoogleGender.Male);
        GoogleMobileAd.AddKeyword("game");
        GoogleMobileAd.SetBirthday(1989, AndroidMonth.MARCH, 18);
        GoogleMobileAd.TagForChildDirectedTreatment(false);

        //Causes a device to receive test ads. The deviceId can be obtained by viewing the device log output after creating a new ad
        //Fill your test device in the plugin setting, or you can add your device using example code bellow

        GoogleMobileAd.AddTestDevice("733770c317dcbf4675fe870d3df9ca42");



        GoogleMobileAd.OnInterstitialLoaded += OnInterstisialsLoaded;
        GoogleMobileAd.OnInterstitialOpened += OnInterstisialsOpen;


        //listening for InApp Event
        //You will only receive in-app purchase (IAP) ads if you specifically configure an IAP ad campaign in the AdMob front end.
        GoogleMobileAd.OnAdInAppRequest += OnInAppRequest;
        InitStyles();
    }
Ejemplo n.º 2
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Start()
    {
        //Required
        GoogleMobileAd.Init();


        //Optional, add data for better ad targeting
        GoogleMobileAd.SetGender(GoogleGenger.Male);
        GoogleMobileAd.AddKeyword("game");
        GoogleMobileAd.SetBirthday(1989, AndroidMonth.MARCH, 18);
        GoogleMobileAd.TagForChildDirectedTreatment(false);

        //Causes a device to receive test ads. The deviceId can be obtained by viewing the device log output after creating a new ad
        GoogleMobileAd.AddTestDevice("733770c317dcbf4675fe870d3df9ca42");



        //More eventts ot explore under GoogleMobileAdEvents class
        GoogleMobileAd.addEventListener(GoogleMobileAdEvents.ON_INTERSTITIAL_AD_LOADED, OnInterstisialsLoaded);
        GoogleMobileAd.addEventListener(GoogleMobileAdEvents.ON_INTERSTITIAL_AD_OPENED, OnInterstisialsOpen);

        //listening for InApp Event
        //You will only receive in-app purchase (IAP) ads if you specifically configure an IAP ad campaign in the AdMob front end.
        GoogleMobileAd.addEventListener(GoogleMobileAdEvents.ON_AD_IN_APP_REQUEST, OnInAppRequest);

        InitStyles();
    }
    public void Init()
    {
        GoogleMobileAd.Init();
        //Optional, add data for better ad targeting
        GoogleMobileAd.SetGender(GoogleGender.Male);
        GoogleMobileAd.AddKeyword("game");
        GoogleMobileAd.SetBirthday(1989, AndroidMonth.MARCH, 18);
        GoogleMobileAd.TagForChildDirectedTreatment(false);

        //Causes a device to receive test ads. The deviceId can be obtained by viewing the logcat output after creating a new ad
        //AndroidAdMobController.instance.AddTestDevice("6B9FA8031AEFDC4758B7D8987F77A5A6");

        GoogleMobileAd.OnInterstitialLoaded += OnInterstisialsLoaded;
        GoogleMobileAd.OnInterstitialOpened += OnInterstisialsOpen;

        AndroidAdMobController.Instance.OnRewardedVideoLoaded   += HandleOnRewardedVideoLoaded;
        AndroidAdMobController.Instance.OnRewardedVideoAdClosed += HandleOnRewardedVideoAdClosed;

        //listening for InApp Event
        //You will only receive in-app purchase (IAP) ads if you specifically configure an IAP ad campaign in the AdMob front end.
        GoogleMobileAd.OnAdInAppRequest += OnInAppRequest;
    }