void initAdmob() { #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting = true; ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(appID, adProperties); //reqired,adProperties can been null }
void initAdmob() { #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/6300978111"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(appID); //optional ad.initAdmob(bannerID, interstitialID); //all id are admob test id,change those to your //ad.setTesting(true);//show test ad //ad.setNonPersonalized(true);//if want load NonPersonalized only,set true // ad.setIsDesignedForFamilies(true);//if is Is Designed For Families set true // ad.setGender(AdmobGender.MALE); // string[] keywords = { "game","crash","male game"}; // ad.setKeywords(keywords);//set keywords for ad Debug.Log("admob inited -------------" + appID); }
void initAdmob() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-2971252247570492~7083194859"; bannerID = "ca-app-pub-2971252247570492/3459876129"; interstitialID = "ca-app-pub-2971252247570492/9123034835"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting(false); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties); //reqired,adProperties can been null }
void initAdmob() { #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting = true; ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(appID, adProperties); //reqired,adProperties can been null FirebaseAnalytic firebase = FirebaseAnalytic.Instance(); //init and start analysis firebase.logEvent("startevent", "{\"player\":\"yingke\"}"); firebase.setUserId("232324432"); firebase.setUserProperty("age", "20"); firebase.setAnalyticsCollectionEnabled(true); }
void initAdmob() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); /* * adProperties.isTesting(true); * adProperties.isAppMuted(true); * adProperties.isUnderAgeOfConsent(false); * adProperties.appVolume(100); * adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); * string[] keywords = { "key1", "key2", "key3" }; * adProperties.keyworks(keywords); */ ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties); //reqired,adProperties can been null }
void initAdmob() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3535705278798960~1140641020"; bannerID = "ca-app-pub-3535705278798960/8527450108"; //bannerID = "ca-app-pub-3940256099942544/6300978111"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting(false); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); //ad.bannerEventHandler += onBannerEvent; //ad.interstitialEventHandler += onInterstitialEvent; //ad.rewardedVideoEventHandler += onRewardedVideoEvent; //ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties);//reqired,adProperties can been null }
void Awake() { DontDestroyOnLoad(gameObject); #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID /*************************************************************/ /***Default Google Admob ID's for Testing***/ /* * * appID = "ca-app-pub-3940256099942544~3347511713"; * bannerID = "ca-app-pub-3940256099942544/6300978111"; * interstitialID = "ca-app-pub-3940256099942544/1033173712"; * videoID = "ca-app-pub-3940256099942544/5224354917"; * nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; */ /*************************************************************/ /*************************************************************/ appID = "ca-app-pub-7880879567842008~2837321958"; bannerID = "ca-app-pub-7880879567842008/7131790188"; //bannerad1 interstitialID = "ca-app-pub-7880879567842008/6940218491"; videoID = "ca-app-pub-7880879567842008/1909407187"; //videoad1 nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; /*************************************************************/ #endif AdProperties adProperties = new AdProperties(); /*************************************************************/ /***Before Launch/Upload on Play Store Check that this prop should be false***/ /** Otherwise no ads will be displayed on Live Game **************************/ adProperties.isTesting = false; /*************************************************************/ ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.initSDK(appID, adProperties);//reqired,adProperties can been null }
public void initAds() { Ad = Admob.Instance(); // Delegate event harus yg paling awal Ad.rewardedVideoEventHandler += VideoEventHandler; // kemudian initialize id app Ad.initSDK(IdApp); // kemudian baru initialize id banner/inter/video/native banner Ad.initAdmob(IdBanner, IdIntertisial); // terakhir Load Ads Ad.loadRewardedVideo(IdVideo); Ad.loadInterstitial(); }
/// <summary> /// Initializing admob /// </summary> void initAdmob() { //These all are test ads, //Please replace it with you ids.. //Seperate Ids for IOS and Android #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerIDTop = "ca-app-pub-3940256099942544/2934735716"; bannerIDBottom = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-3940256099942544~3347511713"; bannerIDTop = "ca-app-pub-3940256099942544/6300978111"; bannerIDBottom = "ca-app-pub-3940256099942544/6300978111"; videoID = "ca-app-pub-3940256099942544/5224354917"; interStitialID = "ca-app-pub-3940256099942544/1033173712"; #endif AdProperties adProperties = new AdProperties(); //NOTE: SET isTesting() TO FALSE WHEN NOT TESTING adProperties.isTesting(true); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); //Registering events.. ad.bannerEventHandler += onBannerEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.initSDK(adProperties); }
void initAdmob() { if (!isTesting) { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-1310604487353159/9931313533"; videoID = "ca-app-pub-1310604487353159/9310767949"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-1310604487353159/6871236007"; interstitialID = "ca-app-pub-1310604487353159/2740419304"; videoID = "ca-app-pub-1310604487353159/8888677644"; nativeBannerID = "ca-app-pub-1310604487353159/5085164008"; #endif } AdProperties adProperties = new AdProperties(); adProperties.isTesting(false); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties);//reqired,adProperties can been null ShowRewardVideo(true); ShowBanner(); }