IOS版添加phonegap---为APP添加CNZZ统计插件教程

1、首先创建App,获取AppKey
在CNZZ MOBILE站点上登录账户,添加App应用,获取AppKey。


2、添加统计代码:
下载IOS SDK


3、添加静态库
将下载的MobileProbe_IOS.zip解压缩,可以得到两个文件:MobileProbe.h和MobileProbe.a。
将这两个文件拖入相应App的XCode工程目录中,在弹出的窗口中勾选:Destination Copy items into destination group’s folder (if needed)。点击Finish,完成静态库添加。


4.添加依赖框架
打开工程Targets的Build Phases选项,在Link Binary With Libraries添加libz.dylib,CoreTelephony.framework,SystemConfiguration.framework。


5.添加编译选项
请在Build Setting中的Other Linker Flags中加入-ObjC。


6.插入统计代码
在AppDelegate.m中添加:
#import "MobileProbe.h"
在函数中添加:
– (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 [MobileProbe initWithAppKey:@"1234567890abcdefghijk" channel:@"iOSChannel"];


注意:其中务必确保填入你在第一步中获取到的App Key。渠道可以填入你所需的渠道名称。


KeyMob是国内优秀的移动广告平台,基于拔尖的技术支持、优质的广告资源,稳定的SDK,为应用开发者提供稳定的广告SDK及移动营销服务。

你可能感兴趣的:(IOS版添加phonegap---为APP添加CNZZ统计插件教程)