Google Admob Integration Error in iOS
I am using GoogleMobileAdsSdkiOS-6.12.2 latest version downloaded from https://developers.google.com/mobile-ads-sdk/download.
If I run on iOS 7.x, I am getting the following errors.
1) CFNetwork SSLHandshake failed (-108)
2) NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -108)
If I run on iOS 8.x, I am getting Crash due to "com.apple.nsurlconnectionloader exc_bad_access" error.
Added below code for integrate Google Admob.
GADBannerView *bannerView = [[GADBannerView alloc]initWithFrame:CGRectMake(0.0,self.view.frame.size.height -GAD_SIZE_320x50.height,GAD_SIZE_320x50.width,GAD_SIZE_320x50.height)];//Set Position
bannerView.adUnitID = #"ca-app-pub-3940256099942544/2934735716";
bannerView.rootViewController = self;
GADRequest *request = [GADRequest request];
request.testDevices = #[ GAD_SIMULATOR_ID, #"MY_TEST_DEVICE_ID" ];
[bannerView loadRequest:request];
Anyone please help me to get out of this issue.
In my case, It is because of the Network blocker issue.
If I run this code in my office, I am getting these type of errors.
If I run same on my home, It is working fine.
Because in my office they are blocking adds.
So I asked my N/W admin to allow adds on my system, He allowed, My issue resolved.
It is a network not getting error.Please check any blocking or Proxy.
Related
Google maps is not showing on Xcode simulator. I've tried it on my actual iPhone however and it works just fine. I then followed this query up apple developer support however, they mentioned that they were unable to help as I initially thought it may have been a simulator issue.
Can anyone advise as to what the issue could be?
The google markers are all showing but just the map view itself shows up blank. Ive tried disabling and re-enabling the Google Maps SDK on the google api console. I've even tried creating new API keys to use but this did not change.
PS. This never used to be an issue before Xcode 9.
Screenshot of Xcode simulator
Here is a snippet of code that I've used to add Google maps to the application:
- (void)viewDidLoad {
[super viewDidLoad];
_mkap=[[GMSMapView alloc]initWithFrame:_mapView.bounds];
_mkap.myLocationEnabled = YES;
_mkap.delegate=self;
NSError *error;
NSURL *url1 =[[NSBundle mainBundle] URLForResource:#"map_white" withExtension:#"json"];
GMSMapStyle *style = [GMSMapStyle styleWithContentsOfFileURL:url1 error:&error];
if (!style) {
NSLog(#"The style definition could not be loaded: %#", error);
}
_mkap.mapStyle = style;
[_mapView addSubview:_mkap];
_arrayPolylineGreen = [[NSMutableArray alloc] init];
}
Not sure if this is a scenario you are in. I faced the same issue with google maps displayed as a gray box in the IOS simulator.
The root cause was the netskope client running in my mac. Once that was disabled, maps started showing streets and roads.
Netskope client details - https://docs.netskope.com/en/netskope-client.html
I am trying to implement Facebook native ads on my device. Test ads are working fine. However, production ads are not showing. It does displays an error showing
DiskCookieStorage changing policy from 2 to 0,cookie file: file:///private/var/mobile/Containers/Data/Application/9B89E486-EDF8-4E20-A7CE-CB60747C3E8B/Library/Cookies/Cookies.binarycookies
and
DiskCookieStorage changing policy from 0 to 2, cookie file: file:///private/var/mobile/Containers/Data/Application/9B89E486-EDF8-4E20-A7CE-CB60747C3E8B/Library/Cookies/Cookies.binarycookies
What I did is loading the ads in viewdidLoad
func setupFacebookNativeAds()
{
let nativeAd = FBNativeAd(placementID: Constants.adMob.FB_NATIVE_ID)
nativeAd.delegate = self
nativeAd.loadAd()
}
What will be the issue here?
I found a solution by adding new test devices in the Monetisation Manager. Get the IDFA for the ios devices and add new test devices. Now the Native Ads view is working.
I'm integrating admob to my application. I have followed a tutorial from youtube, followed the respective steps but when I tried to run the app it shows me an error message that GoogleMobileAds/GADAdSize.h' file not found
I have searched about the error and tried many answers from stack overflow but didn't worked. I have added all the classes and GoogleMobileAds.framework also but this error isn't removing , i'm confused that what the thing i'm missing in this? I have added all the classes from the zip File given in Google Mobile Ads SDK for iOS but still not working how I can resolve this? This is my code for admob,
#import "GADBannerView.h"
GADBannerView *bannerView_;
//Admob Banner
bannerView_ = [[GADBannerView alloc]initWithFrame:CGRectMake(0, 20, 320, 50)];
bannerView_.adUnitID = #"ad unit key";
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[bannerView_ loadRequest:[GADRequest request]];
Now in this import file its showing me this error:
I'm doing everything as in the instructions.
But when I do
[ALInterstitialAd shared].adDisplayDelegate = self;
[ALInterstitialAd shared].adLoadDelegate = self;
[ALInterstitialAd showOver:[[UIApplication sharedApplication] keyWindow]];
I receive code = -1 in
-(void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code
AppLovin SDK reports internal error.
In applovin site all ads is ON, and bundle id the same.
What could it be? Thanks
I connect with AppLovin manager and they told me that because my country is not supported
I released my game with "AppLovin SDK reports internal error" and now it's work correctly. I asked Applovin support and they told me it may be because there is no Ad for user to show at this time.
I have 2 apps with Admob Interstitials.
Admob Interstitial stopped to work in 1 app.
I get exception calling loadRequest method.
Exception: -[__NSCFDictionary setObject:forKey:]: attempt to insert nil key
interestial = [[GADInterstitial alloc] init];
interestial.adUnitID = PUBID;
//interestial.delegate = interestialDelegate;
GADRequest *request = [GADRequest request];
[interestial loadRequest:request];
I made many many I spent day morfing code. Also I have same working code in another app.
May be it is something in project like missing framework or else
I tried Admob 6.3.0, 6.2.1, 6.1.5
Major change to my Admob code was upgrade to 6.3.0 but second app was also upgraded.
I am logging PUBID. It is not nil.
I do not pass NSDictionary to Admob my self.
The difference between apps is that it works in app with ARC and fails in non ARC app.
The most common problem is -ObjC flag in Other Linker Flags