Add mob issue in ios

  • amisha
    Likes 0

    Problem Description

    when i implement addmob in ios as shown your video then add is not shown even id is correct

    error n logcat is like:

    <Google> Invalid Request: {
        "activation_overlay_url" = "http://googleads.g.doubleclick.net/mads/static/activation_overlay.html?hl=en";
        "base_uri" = "https:";
        "enable_auto_click_protection" = 0;
        errors = "Cannot determine request type. Is your ad unit id correct?";
        "google.afma.Notify_dt" = 1440231872770;
        "request_id" = 2;
        "request_scenario" = "online_request";
        type = unknown;
        "use_webview_loadurl" = 0;
    }

  • Sonar Systems admin
    Likes 0

    What version of the Cocos Helper are you using?

  • amisha
    Likes 0

     Cocos Helper v1.46.00

  • Sonar Systems admin
    Likes 0

    Is this Cocos2d-x or Cocos2d-JS?

  • amisha
    Likes 0

    cocos2d-x   c++

  • Sonar Systems admin
    Likes 0

    Hello

     

    Have you called SonarCocosHelper::IOS::Setup();

    ?


    This reply has been verified.
  • amisha
    Likes 0

    yes ..

    i called this both.

     SonarCocosHelper::IOS::Setup();
      SonarCocosHelper::AdMob::showBannerAd();

  • Sonar Systems admin
    Likes 0

    I just tried it and it works on mine, are using a simulator or device?

  • amisha
    Likes 0

    i try on both device  and simulator.

  • Sonar Systems admin
    Likes 0

    What is your Xcode project target set to?

  • amisha
    Likes 0

      8.0

  • Sonar Systems admin
    Likes 0

    What version of Cocos are you using?

  • amisha
    Likes 0

    3.7.1        

  • Sonar Systems admin
    Likes 0

    Try the process again

  • amisha
    Likes 0

    ok..sure

  • amisha
    Likes 0

    I try it again same process but still same error occure .

  • Sonar Systems admin
    Likes 0

    This is really weird as I tried it and it works, could you show us the SCHSettings.h file

  • amisha
    Likes 0

    /*
     Copyright (C) 2015 Sonar Systems - All Rights Reserved
     You may use, distribute and modify this code under the
     terms of the MIT license
     
     Any external frameworks used have their own licenses and
     should be followed as such.
    */
    //
    //  SCHSettings.h
    //  Sonar Cocos Helper
    //
    //  Created by Sonar Systems on 03/03/2015.
    //
    //
    
    #ifndef __SCHSettings_h__
    #define __SCHSettings_h__
    
    #define SCH_IS_iADS_ENABLED false // iAd.framework
    #define SCH_IS_AD_MOB_ENABLED true // AdSupport.framework, AudioToolbox.framework, AVFoundation.framework, CoreGraphics.framework, CoreMedia.framework, CoreTelephony.framework, EventKit.framework, EventKitUI.framework, MessageUI.framework, StoreKit.framework, SystemConfiguration.framework
    #define SCH_IS_CHARTBOOST_ENABLED false // StoreKit.framework, Foundation.framework, CoreGraphics.framework, UIKit.framework
    #define SCH_IS_REVMOB_ENABLED false // SystemConfiguration.framework, StoreKit.framework, MediaPlayer.framework, AdSupport.framework
    #define SCH_IS_SOCIAL_ENABLED true// Social.framework
    #define SCH_IS_GAME_CENTER_ENABLED false // Social.framework, GameKit.framework
    //#define SCH_IS_EVERYPLAY_ENABLED false // AdSupport (iOS 6+, set to Optional link for pre-iOS 6 compatibility).framework, AssetsLibrary.framework, AudioToolbox.framework, AVFoundation.framework, CoreGraphics.framework, CoreImage (iOS 5+, set to Optional link for pre-iOS 5 compatibility).framework, CoreMedia.framework, CoreVideo.framework, Foundation.framework, MessageUI.framework, MobileCoreServices.framework, OpenGLES.framework, QuartzCore.framework, Security.framework, Social (iOS 6+, set to Optional link for pre-iOS 6 compatibility).framework, StoreKit.framework, SystemConfiguration.framework, Twitter (iOS 5+, set to Optional link for pre-iOS 5 compatibility).framework, UIKit.framework
    #define SCH_IS_MOPUB_ENABLED false // AdSupport.framework, CoreGraphics.framework, CoreLocation.framework, CoreTelephony.framework, EventKit.framework, EventKitUI.framework, Foundation.framework, GameController.framework, GameKit.framework, MediaPlayer.framework, MessageUI.framework, QuartzCore.framework, StoreKit.framework†, SystemConfiguration.framework, UIKit.framework
    // MOPUB also needs these Linker flags
    // -ObjC
    // -fobjc-arc to every MoPub file
    #define SCH_IS_GOOGLE_ANALYTICS_ENABLED false // CoreData.framework, SystemConfiguration.framework, libz.dylib, libsqlite3.dylib, libGoogleAnalyticsServices.a, libAdIdAccess.a, AdSupport.framework, iAd.framework, GameController.framework
    // GOOGLE ANALYTICS also needs these Linker flags for IDFA
    // -framework AdSupport
    // -force_load "${SRCROOT}/GoogleAnalyticsFramework/libAdIdAccess.a"
    #define SCH_IS_ADCOLONY_ENABLED false // AdColony.framework, AdSupport.framework (Set to Optional), AudioToolbox.framework, AVFoundation.framework, CoreGraphics.framework, CoreMedia.framework, CoreTelephony.framework, EventKit.framework, EventKitUI.framework, GameController.framework, libsqlite3.dylib, libz.1.2.5.dylib, MediaPlayer.framework, MessageUI.framework, QuartzCore.framework, Social.framework (Set to Optional), StoreKit.framework (Set to Optional), SystemConfiguration.framework, WebKit.framework (Set to Optional)
    // ADCOLONY also needs these Linker flags
    // -ObjC
    // -fobjc-arc
    #define SCH_IS_VUNGLE_ENABLED false // AdSupport.framework, AudioToolbox.framework, AVFoundation.framework, CFNetwork.framework, CoreGraphics.framework, CoreMedia.framework, Foundation.framework, libz.dylib, libsqlite3.dylib, MediaPlayer.framework, QuartzCore.framework, StoreKit.framework, SystemConfiguration.framework, UIKit.framework
    #define SCH_IS_WECHAT_ENABLED false // libWeCharSDK.a, WXApi.h, WXApiObject.h, SystemConfiguration.framework, libz.dylib, libsqlite3.0.dylib
    #define SCH_IS_NOTIFICATIONS_ENABLED false
    
    
    #define SCH_ADCOLONY_APP_ID @""
    #define SCH_ADCOLONY_ZONE_ID @""
    
    #define SCH_VUNGLE_ID @""
    
    #define SCH_MOPUB_BANNER_AD_UNIT @""
    #define SCH_MOPUB_INTERSTITIAL_AD_UNIT @""
    
    #define SCH_CHARTBOOST_APP_ID @""
    #define SCH_CHARTBOOST_APP_SIGNATURE @""
    
    #define SCH_REVMOB_MEDIA_ID @""
    
    #define SCH_AD_MOB_TOP_BANNER_AD_UNIT_ID @""
    #define SCH_AD_MOB_BOTTOM_BANNER_AD_UNIT_ID @"ca-app-pub-9937376956444860/4698396530"
    #define SCH_AD_MOB_FULLSCREEN_AD_UNIT_ID @"ca-app-pub-9937376956444860/6175129731"
    #define SCH_AD_MOB_TEST_DEVICE @"fbce0e5b6e863653dbf0dae8e1523c10"
    
    #define SCH_GOOGLE_ANALYTICS_TRACKING_ID @""
    
    //#define SCH_EVERYPLAY_CLIENT_ID @""
    //#define SCH_EVERYPLAY_CLIENT_SECRET @""
    
    
    #define SCH_WECHAT_APP_ID @""
    
    #endif
    

     


  • Sonar Systems admin
    Likes 0

    What code are you using to show your AdMob ad?


    This reply has been verified.
  • amisha
    Likes 0

     SonarCocosHelper::IOS::Setup();
      SonarCocosHelper::AdMob::showBannerAd();

     

    this above 2 line

     

  • Sonar Systems admin
    Likes 0

    That’s the problem, by default the showBannerAd method displays an ad at the top of the screen but you haven’t set 

    SCH_AD_MOB_TOP_BANNER_AD_UNIT_ID

    Either set that or if you want to display it at the bottom call 

    SonarCocosHelper::AdMob::showAdMobBanner( AdBannerPosition::eBottom )


    This reply has been verified.
  • amisha
    Likes 0

    ok done ….but  i want to change the dimension of add then where is the change for that??

  • Sonar Systems admin
    Likes 0

    We don’t have that built in ATM, you can change the native code as it’s an open source.

  • amisha
    Likes 0

    ok sir ..Thank you  for help me

  • Sonar Systems admin
    Likes 0

    Your very welcome :D

Login to reply