Esempio n. 1
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();
    }