Integrate Ads in IOS application tutorial
To display ads in mobile applications need to add ad library to app, 20150801 is the current
version of Keymob library , you will find ios project files and directories in the folder you downloaded, the following resources are Keymob library
related. Download IOS lib
- README.md keymob quickly integrate document in English
- README_ios_zh.md keymob quickly integrate document in Chinese
- keymobsdk
- KeymobAd.framework keymob core library
- plugins platform SDK library supported by
keymob
you need add libs in plugins to project ,not need other file from ad platform.
Using advertising management library need the following a few steps
- Right-click the xcode project, open the properties, select "add files to the project" menu, add
keymobsdk directory to the xcode project
- Add -fore_load item in Other Linker Flags . For example, using the admob and inmobi need to add the following items.
suppose
"$(SRCROOT)/keymobsdk/plugins/" is the keymob library path.
-force_load $(SRCROOT)/keymobsdk/plugins/Admob/libAdmobAdapter.a
-force_load $(SRCROOT)/keymobsdk/plugins/inmobi/libInmobiAdapter.a
Note: if you don't add - force_load will not see third-party ads, log message "the platform not support"
1.Import keymob header files
#import <KeymobAd/KeymobAd.h>
2.Initialize Keymob
Initialization Keymob library management is the prerequisite to call other advertising functions, the following initialization method is to use the Keymob.com service
[[AdManager sharedInstance] setController: self andListener: [[AdListener alloc] init]];
[[AdManager sharedInstance] configWithKeymobService: @ "1" isTesting: YES];
setController parameters
- "self" the first parameter is advertising context, not nil
- "AdListener" the second parameter is the delegate handler ad event implementing IAdEventListener protocol,
if you don't plan to deal with advertising events can set it nil
configWithKeymobService parameters
- "1" is Keymob application ID got from Keymob.com
- "YES" the second parameter is the test mode switch, set to YES when debugging, set to NO when release.
3. display advertising
Shown below the banner ads in the absolute position (0,200) sample
[[AdManager sharedInstance] showBannerABS:BANNER_SIZE_BANNER atX:0 atY:200];
Parameters Description
- BANNER_SIZE_BANNER the first parameter is AD sizes, all the supported banners sizes are constants named
BANNER_SIZE_xxx
- "0" the second parameter is the location of the advertising x
- "200" the third parameter is the location of the advertising y
More tutorial of add ad in app qq group 310513042 home