Integrate advertising in cordova application
To display ads in mobile applications need to ads plugins, 20150801 is the current
version of ad management plugin Keymob, you wil see that the plugin contains common plugin files SRC, WWW, plugin.xml, as well as example, iosadapter,
readme.md, readme_zh.md
- README.md keymob quickly integrate document in English
- README_zh.md keymob quickly integrate document in Chinese
- src Keymob advertising management library code ios and android code
- www Keymob advertising plugin js modules
- Example advertising management plugin Example files
- iosadapters ios adapter and third-party advertising platform SDK
Add using advertising management library need the following a few steps
- Download and unpack keymob advertising management plugin
- Use the command to install the plugin, assuming that path of the plugin is d: \ keymobplugin
cordova plugin add d:\keymobplugin
1. Initialization Keymob
Initialization Keymob library management is the prerequisite to call other advertising functions, the following initialization method is to use the Keymob.com service
keymob.initFromKeymobService("1", true);
Parameter Description
- "1" the first parameter is the ID Keymob application, at Keymob.com for creating an application
ID
- "true" "false" Whether testing mode, set to true when debug, set false when released
2.The display advertising
Shown the banner ads at the absolute position (0,200)
keymob.showBannerAbsolute(keymob.AdSize.BANNER,0,200);
- Parameters that
- AdSizes.BANNER the first parameter is size, all the default support advertising banners size in AdSizes
class
- "0" the second parameter is the location of x
- "200" the second parameter is the location of y
You need add the platform libraries to the project path, open the project with xcode, then right-click on the
project, select "add files to project" , choose files under folder iosadapters . If use gdt, you
need to add -lstdc++ to Other Linker Flags.
Generated in the android project assets directory below there are three folders,
biduad_plugin is baidu platform
resources, if you do not use baidu advertising you can deleted it
gdt_plugin is gdt reqired files, if not
used gdt ads can be deleted
com_keymob_sdks is Keymob default advertising platform, you can change it to other platform
https://github.com/keymobdev/admob-adapter
Note:these 3 folder name cannot be modified
More tutorial of add ad in app qq group 310513042 home