简体   繁体   中英

An error occurs when adding InMobi in AdMob Mediation

The following error will appear when I add in InMobi iOS:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IMAdView initWithFrame:imAppId:imAdUnit:rootViewController:]: unrecognized selector sent to instance 0xb9e2080'

I have the following:

・ AdMob Mediation SDK add
・ InMobi adapter and SDK add
・ Other Linker Flags add -ObjC and -all_load**

Still missing something? Do you need or import?

It looks like you aren't calling this method on a proper IMAdView object. As per the documentation , this works:

IMAdView *someAdView = [[IMAdView alloc] initWithFrame:CGRectMake(0, 0, 320, 50) imAppId:@"YOUR_INMOBI_APP_ID" imAdSize:IM_UNIT_320x50 rootViewController:self];

You have to allocate an object with alloc before initializing it.

I had this problem, too, when I updated my Google AdMob SDK to ver 6.4.2, and the InMobiAdMobiOSAdapter, to whatever the latest version is, but neglected to update the inMobi SDK to 3.7.0.

On this page: https://developers.google.com/mobile-ads-sdk/docs/admob/mediation-networks look at the row for InMobi. You have to download both the adapter("adapter for iOS") and the SDK ("Download iOS"), and incorporate them into your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM