diff --git "a/BaiduMTJ/crash\350\247\243\346\236\220\347\233\270\345\205\263_readme.txt" "b/BaiduMTJ/crash\350\247\243\346\236\220\347\233\270\345\205\263_readme.txt" new file mode 100644 index 0000000..36d0c1f --- /dev/null +++ "b/BaiduMTJ/crash\350\247\243\346\236\220\347\233\270\345\205\263_readme.txt" @@ -0,0 +1,4 @@ +百度移动统计SDK(iOS) Crash版收集的Crash日志,需要百度移动统计服务端解析后,方可阅读。 百度移动统计Symbol工具,是抽取用户应用的dSYM文件中的信息,生成数据包,供百度移动统计服务端解析Crash日志所用。 + 百度移动统计Symbol工具下载地址: 1.登陆mtj.baidu.com 2.点击查看报告,进入某个应用详情。 3.在左侧导航栏,找到设置-文件管理,在该页面可下载工具。 +4.Symbol工具使用简单,具体可详见Symbol工具包中的文档。 + 如有其他问题可以参考网站的FAQ,或者与我们联系:(apptongji@baidu.com) \ No newline at end of file diff --git a/BaiduMTJ/ios_api/Release-iphoneos/BaiduMobStat.h b/BaiduMTJ/ios_api/Release-iphoneos/BaiduMobStat.h new file mode 100644 index 0000000..a649015 --- /dev/null +++ b/BaiduMTJ/ios_api/Release-iphoneos/BaiduMobStat.h @@ -0,0 +1,212 @@ +// +// BaiduMobStat.h +// BaiduMobStat +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import +#import + +@class UIViewController; + +/** + * 鏃ュ織鍙戦佺瓥鐣 + */ +typedef enum _BaiduMobStatLogStrategy { + BaiduMobStatLogStrategyAppLaunch = 0, //姣忔绋嬪簭鍚姩鏃跺彂閫侊紙榛樿绛栫暐锛屾帹鑽愪娇鐢!锛 + BaiduMobStatLogStrategyDay = 1, //姣忓ぉ鐨勭▼搴忕涓娆¤繘鍏ュ惎鍔 + BaiduMobStatLogStrategyCustom = 2, //鏍规嵁璁惧畾鐨勬椂闂撮棿闅斿彂閫 +} BaiduMobStatLogStrategy; + +/** + * 鑷姩鐩戞帶绛栫暐 + * 鍚姩鑷姩鐩戞帶绛栫暐鍚庯紝鍘熷厛鐩稿簲璋冪敤Api鎵嬪姩鍩嬬偣鐨勪唬鐮侀渶瑕佸垹闄わ紝閬垮厤閲嶅缁熻锛侊紒 + * 涓句緥锛氬惎鍔˙aiduMobStatMonitorStrategyPageView绛栫暐锛屽垯涓嶉渶瑕佽皟鐢╬ageviewStartWithName绛夋帴鍙h繘琛岄〉闈㈢粺璁° + */ +typedef enum _BaiduMobStatMonitorStrategy { + BaiduMobStatMonitorStrategyNone = 0, //涓嶅惎鐢ㄨ嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyPageView = 1, //鍙惎鍔ㄩ〉闈㈢粺璁¤嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyButton = 2, //鍙惎鍔╞utton缁熻鑷姩鐩戞帶 + BaiduMobStatMonitorStrategyAll = 3, //鍚姩椤甸潰缁熻涓巄utton缁熻鑷姩鐩戞帶 +} BaiduMobStatMonitorStrategy; + +/** + * 鐧惧害绉诲姩搴旂敤缁熻鎺ュ彛 + * 褰撳墠鐗堟湰 V3.7.2.0 + */ +@interface BaiduMobStat : NSObject + +/** + * 浠ヤ笅property灞炴э紝鍧囦负鍙夎缃 + */ + +/** + * 璁剧疆app鐨勭増鏈彿 + * 鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 + * 鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏 + */ +@property (nonatomic, copy) NSString *shortAppVersion; + +/** + * 璁剧疆娓犻亾Id + * 榛樿鍊间负 "AppStore" + */ +@property (nonatomic, copy) NSString *channelId; + +/** + * 鏄惁鍚敤Crash鏃ュ織鏀堕泦 + * 榛樿鍊 YES + */ +@property (nonatomic) BOOL enableExceptionLog; + +/** + * 鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL logSendWifiOnly; + +/** + * 璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s + * 渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 + * 榛樿鍊 30s + */ +@property (nonatomic) int sessionResumeInterval; + +/** + * 璁剧疆鏃ュ織鍙戦佺瓥鐣 + * 榛樿鍊 BaiduMobStatLogStrategyAppLaunch + */ +@property (nonatomic) BaiduMobStatLogStrategy logStrategy; + +/** + * 璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 + * 褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 + * 鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 + * 榛樿鍊间负 1 + */ +@property (nonatomic) int logSendInterval; + +/** + * 璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL enableDebugOn; + +/** + * 璁剧疆璁惧adid + * 鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ + * 榛樿鍊 绌哄瓧绗︿覆:@"" + */ +@property (nonatomic, copy) NSString *adid; + +/** + * 璁剧疆鑷姩鐩戞帶绛栫暐 + * 榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺 + */ +@property (nonatomic, assign) BaiduMobStatMonitorStrategy monitorStrategy; + +/** + * 鑾峰彇缁熻瀵硅薄鐨勫疄渚 + * + * @return 涓涓粺璁″璞″疄渚 + */ ++ (BaiduMobStat *)defaultStat; + +/** + * 璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 + * 娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆 + * + * @param appkey 鐢ㄦ埛鍦╩tj缃戠珯涓婂垱寤哄簲鐢紝鑾峰彇瀵瑰簲鐨刟ppKey + */ +- (void)startWithAppId:(NSString *)appKey; + +/** + * 璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + * @param duration 宸茬煡鐨勮嚜瀹氫箟浜嬩欢鏃堕暱锛屽崟浣嶄负姣锛坢s锛 + */ +- (void)logEventWithDurationTime:(NSString *)eventId eventLabel:(NSString *)eventLabel durationTime:(unsigned long)duration; + +/** + * 璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewStartWithName:(NSString *)name; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewEndWithName:(NSString *)name; + +/** + * 璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 + * 鍦║IWebView鐨勪唬鐞嗘柟娉曪細 + * - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType + * 涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔 + * + * @param request UIWebView鐨勮姹傚弬鏁 + */ +- (void)webviewStartLoadWithRequest:(NSURLRequest *)request; + +/** + * 鑾峰彇cuid鐨勫 + * 杩斿洖SDK鐢熸垚鐨刢uid + * + * @return 璁惧Cuid + */ +- (NSString *)getDeviceCuid; + +@end + +/** + * Category 澹版槑 + */ +#define BAIDU_MOB_STAT_DEFINE_CATEGORY \ +@interface UIViewController (BaiduMobStatViewController) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@end \ +@interface UIWindow (BaiduMobStatWindow) \ +@end \ +@interface UIButton (BaiduMobStatButton) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@property (nonatomic, strong) NSString *labelForBaiduMobStat; \ +@end + +BAIDU_MOB_STAT_DEFINE_CATEGORY + + diff --git a/BaiduMTJ/ios_api/Release-iphoneos/libBaiduMobStat.a b/BaiduMTJ/ios_api/Release-iphoneos/libBaiduMobStat.a new file mode 100644 index 0000000..3dd2564 Binary files /dev/null and b/BaiduMTJ/ios_api/Release-iphoneos/libBaiduMobStat.a differ diff --git a/BaiduMTJ/ios_api/Release-iphonesimulator/BaiduMobStat.h b/BaiduMTJ/ios_api/Release-iphonesimulator/BaiduMobStat.h new file mode 100644 index 0000000..a649015 --- /dev/null +++ b/BaiduMTJ/ios_api/Release-iphonesimulator/BaiduMobStat.h @@ -0,0 +1,212 @@ +// +// BaiduMobStat.h +// BaiduMobStat +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import +#import + +@class UIViewController; + +/** + * 鏃ュ織鍙戦佺瓥鐣 + */ +typedef enum _BaiduMobStatLogStrategy { + BaiduMobStatLogStrategyAppLaunch = 0, //姣忔绋嬪簭鍚姩鏃跺彂閫侊紙榛樿绛栫暐锛屾帹鑽愪娇鐢!锛 + BaiduMobStatLogStrategyDay = 1, //姣忓ぉ鐨勭▼搴忕涓娆¤繘鍏ュ惎鍔 + BaiduMobStatLogStrategyCustom = 2, //鏍规嵁璁惧畾鐨勬椂闂撮棿闅斿彂閫 +} BaiduMobStatLogStrategy; + +/** + * 鑷姩鐩戞帶绛栫暐 + * 鍚姩鑷姩鐩戞帶绛栫暐鍚庯紝鍘熷厛鐩稿簲璋冪敤Api鎵嬪姩鍩嬬偣鐨勪唬鐮侀渶瑕佸垹闄わ紝閬垮厤閲嶅缁熻锛侊紒 + * 涓句緥锛氬惎鍔˙aiduMobStatMonitorStrategyPageView绛栫暐锛屽垯涓嶉渶瑕佽皟鐢╬ageviewStartWithName绛夋帴鍙h繘琛岄〉闈㈢粺璁° + */ +typedef enum _BaiduMobStatMonitorStrategy { + BaiduMobStatMonitorStrategyNone = 0, //涓嶅惎鐢ㄨ嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyPageView = 1, //鍙惎鍔ㄩ〉闈㈢粺璁¤嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyButton = 2, //鍙惎鍔╞utton缁熻鑷姩鐩戞帶 + BaiduMobStatMonitorStrategyAll = 3, //鍚姩椤甸潰缁熻涓巄utton缁熻鑷姩鐩戞帶 +} BaiduMobStatMonitorStrategy; + +/** + * 鐧惧害绉诲姩搴旂敤缁熻鎺ュ彛 + * 褰撳墠鐗堟湰 V3.7.2.0 + */ +@interface BaiduMobStat : NSObject + +/** + * 浠ヤ笅property灞炴э紝鍧囦负鍙夎缃 + */ + +/** + * 璁剧疆app鐨勭増鏈彿 + * 鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 + * 鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏 + */ +@property (nonatomic, copy) NSString *shortAppVersion; + +/** + * 璁剧疆娓犻亾Id + * 榛樿鍊间负 "AppStore" + */ +@property (nonatomic, copy) NSString *channelId; + +/** + * 鏄惁鍚敤Crash鏃ュ織鏀堕泦 + * 榛樿鍊 YES + */ +@property (nonatomic) BOOL enableExceptionLog; + +/** + * 鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL logSendWifiOnly; + +/** + * 璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s + * 渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 + * 榛樿鍊 30s + */ +@property (nonatomic) int sessionResumeInterval; + +/** + * 璁剧疆鏃ュ織鍙戦佺瓥鐣 + * 榛樿鍊 BaiduMobStatLogStrategyAppLaunch + */ +@property (nonatomic) BaiduMobStatLogStrategy logStrategy; + +/** + * 璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 + * 褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 + * 鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 + * 榛樿鍊间负 1 + */ +@property (nonatomic) int logSendInterval; + +/** + * 璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL enableDebugOn; + +/** + * 璁剧疆璁惧adid + * 鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ + * 榛樿鍊 绌哄瓧绗︿覆:@"" + */ +@property (nonatomic, copy) NSString *adid; + +/** + * 璁剧疆鑷姩鐩戞帶绛栫暐 + * 榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺 + */ +@property (nonatomic, assign) BaiduMobStatMonitorStrategy monitorStrategy; + +/** + * 鑾峰彇缁熻瀵硅薄鐨勫疄渚 + * + * @return 涓涓粺璁″璞″疄渚 + */ ++ (BaiduMobStat *)defaultStat; + +/** + * 璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 + * 娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆 + * + * @param appkey 鐢ㄦ埛鍦╩tj缃戠珯涓婂垱寤哄簲鐢紝鑾峰彇瀵瑰簲鐨刟ppKey + */ +- (void)startWithAppId:(NSString *)appKey; + +/** + * 璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + * @param duration 宸茬煡鐨勮嚜瀹氫箟浜嬩欢鏃堕暱锛屽崟浣嶄负姣锛坢s锛 + */ +- (void)logEventWithDurationTime:(NSString *)eventId eventLabel:(NSString *)eventLabel durationTime:(unsigned long)duration; + +/** + * 璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewStartWithName:(NSString *)name; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewEndWithName:(NSString *)name; + +/** + * 璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 + * 鍦║IWebView鐨勪唬鐞嗘柟娉曪細 + * - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType + * 涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔 + * + * @param request UIWebView鐨勮姹傚弬鏁 + */ +- (void)webviewStartLoadWithRequest:(NSURLRequest *)request; + +/** + * 鑾峰彇cuid鐨勫 + * 杩斿洖SDK鐢熸垚鐨刢uid + * + * @return 璁惧Cuid + */ +- (NSString *)getDeviceCuid; + +@end + +/** + * Category 澹版槑 + */ +#define BAIDU_MOB_STAT_DEFINE_CATEGORY \ +@interface UIViewController (BaiduMobStatViewController) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@end \ +@interface UIWindow (BaiduMobStatWindow) \ +@end \ +@interface UIButton (BaiduMobStatButton) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@property (nonatomic, strong) NSString *labelForBaiduMobStat; \ +@end + +BAIDU_MOB_STAT_DEFINE_CATEGORY + + diff --git a/BaiduMTJ/ios_api/Release-iphonesimulator/libBaiduMobStat.a b/BaiduMTJ/ios_api/Release-iphonesimulator/libBaiduMobStat.a new file mode 100644 index 0000000..b51f555 Binary files /dev/null and b/BaiduMTJ/ios_api/Release-iphonesimulator/libBaiduMobStat.a differ diff --git a/BaiduMTJ/ios_api/universal-bin/BaiduMobStat.h b/BaiduMTJ/ios_api/universal-bin/BaiduMobStat.h new file mode 100644 index 0000000..a649015 --- /dev/null +++ b/BaiduMTJ/ios_api/universal-bin/BaiduMobStat.h @@ -0,0 +1,212 @@ +// +// BaiduMobStat.h +// BaiduMobStat +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import +#import + +@class UIViewController; + +/** + * 鏃ュ織鍙戦佺瓥鐣 + */ +typedef enum _BaiduMobStatLogStrategy { + BaiduMobStatLogStrategyAppLaunch = 0, //姣忔绋嬪簭鍚姩鏃跺彂閫侊紙榛樿绛栫暐锛屾帹鑽愪娇鐢!锛 + BaiduMobStatLogStrategyDay = 1, //姣忓ぉ鐨勭▼搴忕涓娆¤繘鍏ュ惎鍔 + BaiduMobStatLogStrategyCustom = 2, //鏍规嵁璁惧畾鐨勬椂闂撮棿闅斿彂閫 +} BaiduMobStatLogStrategy; + +/** + * 鑷姩鐩戞帶绛栫暐 + * 鍚姩鑷姩鐩戞帶绛栫暐鍚庯紝鍘熷厛鐩稿簲璋冪敤Api鎵嬪姩鍩嬬偣鐨勪唬鐮侀渶瑕佸垹闄わ紝閬垮厤閲嶅缁熻锛侊紒 + * 涓句緥锛氬惎鍔˙aiduMobStatMonitorStrategyPageView绛栫暐锛屽垯涓嶉渶瑕佽皟鐢╬ageviewStartWithName绛夋帴鍙h繘琛岄〉闈㈢粺璁° + */ +typedef enum _BaiduMobStatMonitorStrategy { + BaiduMobStatMonitorStrategyNone = 0, //涓嶅惎鐢ㄨ嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyPageView = 1, //鍙惎鍔ㄩ〉闈㈢粺璁¤嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyButton = 2, //鍙惎鍔╞utton缁熻鑷姩鐩戞帶 + BaiduMobStatMonitorStrategyAll = 3, //鍚姩椤甸潰缁熻涓巄utton缁熻鑷姩鐩戞帶 +} BaiduMobStatMonitorStrategy; + +/** + * 鐧惧害绉诲姩搴旂敤缁熻鎺ュ彛 + * 褰撳墠鐗堟湰 V3.7.2.0 + */ +@interface BaiduMobStat : NSObject + +/** + * 浠ヤ笅property灞炴э紝鍧囦负鍙夎缃 + */ + +/** + * 璁剧疆app鐨勭増鏈彿 + * 鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 + * 鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏 + */ +@property (nonatomic, copy) NSString *shortAppVersion; + +/** + * 璁剧疆娓犻亾Id + * 榛樿鍊间负 "AppStore" + */ +@property (nonatomic, copy) NSString *channelId; + +/** + * 鏄惁鍚敤Crash鏃ュ織鏀堕泦 + * 榛樿鍊 YES + */ +@property (nonatomic) BOOL enableExceptionLog; + +/** + * 鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL logSendWifiOnly; + +/** + * 璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s + * 渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 + * 榛樿鍊 30s + */ +@property (nonatomic) int sessionResumeInterval; + +/** + * 璁剧疆鏃ュ織鍙戦佺瓥鐣 + * 榛樿鍊 BaiduMobStatLogStrategyAppLaunch + */ +@property (nonatomic) BaiduMobStatLogStrategy logStrategy; + +/** + * 璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 + * 褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 + * 鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 + * 榛樿鍊间负 1 + */ +@property (nonatomic) int logSendInterval; + +/** + * 璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL enableDebugOn; + +/** + * 璁剧疆璁惧adid + * 鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ + * 榛樿鍊 绌哄瓧绗︿覆:@"" + */ +@property (nonatomic, copy) NSString *adid; + +/** + * 璁剧疆鑷姩鐩戞帶绛栫暐 + * 榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺 + */ +@property (nonatomic, assign) BaiduMobStatMonitorStrategy monitorStrategy; + +/** + * 鑾峰彇缁熻瀵硅薄鐨勫疄渚 + * + * @return 涓涓粺璁″璞″疄渚 + */ ++ (BaiduMobStat *)defaultStat; + +/** + * 璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 + * 娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆 + * + * @param appkey 鐢ㄦ埛鍦╩tj缃戠珯涓婂垱寤哄簲鐢紝鑾峰彇瀵瑰簲鐨刟ppKey + */ +- (void)startWithAppId:(NSString *)appKey; + +/** + * 璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + * @param duration 宸茬煡鐨勮嚜瀹氫箟浜嬩欢鏃堕暱锛屽崟浣嶄负姣锛坢s锛 + */ +- (void)logEventWithDurationTime:(NSString *)eventId eventLabel:(NSString *)eventLabel durationTime:(unsigned long)duration; + +/** + * 璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewStartWithName:(NSString *)name; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewEndWithName:(NSString *)name; + +/** + * 璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 + * 鍦║IWebView鐨勪唬鐞嗘柟娉曪細 + * - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType + * 涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔 + * + * @param request UIWebView鐨勮姹傚弬鏁 + */ +- (void)webviewStartLoadWithRequest:(NSURLRequest *)request; + +/** + * 鑾峰彇cuid鐨勫 + * 杩斿洖SDK鐢熸垚鐨刢uid + * + * @return 璁惧Cuid + */ +- (NSString *)getDeviceCuid; + +@end + +/** + * Category 澹版槑 + */ +#define BAIDU_MOB_STAT_DEFINE_CATEGORY \ +@interface UIViewController (BaiduMobStatViewController) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@end \ +@interface UIWindow (BaiduMobStatWindow) \ +@end \ +@interface UIButton (BaiduMobStatButton) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@property (nonatomic, strong) NSString *labelForBaiduMobStat; \ +@end + +BAIDU_MOB_STAT_DEFINE_CATEGORY + + diff --git a/BaiduMTJ/ios_api/universal-bin/libBaiduMobStat.a b/BaiduMTJ/ios_api/universal-bin/libBaiduMobStat.a new file mode 100644 index 0000000..3863176 Binary files /dev/null and b/BaiduMTJ/ios_api/universal-bin/libBaiduMobStat.a differ diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.pbxproj b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b43156c --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.pbxproj @@ -0,0 +1,387 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2226CA24147362A900E4179C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2226CA23147362A900E4179C /* CoreLocation.framework */; }; + 226182E11463921B0021CA0D /* MyPageLogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 226182DF1463921B0021CA0D /* MyPageLogViewController.m */; }; + 2275572A14600461002FFD6B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2275572914600461002FFD6B /* UIKit.framework */; }; + 2275572C14600461002FFD6B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2275572B14600461002FFD6B /* Foundation.framework */; }; + 2275572E14600461002FFD6B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2275572D14600461002FFD6B /* CoreGraphics.framework */; }; + 2275573414600461002FFD6B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2275573214600461002FFD6B /* InfoPlist.strings */; }; + 2275573614600461002FFD6B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2275573514600461002FFD6B /* main.m */; }; + 2275573A14600461002FFD6B /* BaiduMobStatAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2275573914600461002FFD6B /* BaiduMobStatAppDelegate.m */; }; + 22C01BDD1462697C00704D20 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22C01BDC1462697C00704D20 /* CoreTelephony.framework */; }; + 22E2C0BF14720BBE00917548 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E2C0BE14720BBE00917548 /* SystemConfiguration.framework */; }; + 766EAE361522E7CB006A9109 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 766EAE351522E7CB006A9109 /* icon.png */; }; + DAA49FAA172CC57600643216 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA49FA9172CC57600643216 /* Security.framework */; }; + DAA49FAC172CC5AB00643216 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DAA49FAB172CC5AB00643216 /* Default-568h@2x.png */; }; + E160B7041C31296A00371DFD /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E160B7031C31296A00371DFD /* JavaScriptCore.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + E17D0EA01B6F4B77000BC66B /* libBaiduMobStat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E17D0E9F1B6F4B77000BC66B /* libBaiduMobStat.a */; }; + E181D3EF1A232C6C00E67202 /* WebViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E181D3EE1A232C6C00E67202 /* WebViewViewController.m */; }; + E19B3F831AB1707300B24474 /* mobstat.js in Resources */ = {isa = PBXBuildFile; fileRef = E19B3F821AB1707300B24474 /* mobstat.js */; }; + E19B3F851AB1749C00B24474 /* mobstat.html in Resources */ = {isa = PBXBuildFile; fileRef = E19B3F841AB1749C00B24474 /* mobstat.html */; }; + E1C8D9151B6F5C91000ED95D /* libz.1.2.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 229683CC1468FD1500794E11 /* libz.1.2.5.dylib */; }; + E1C8D9161B6F5C9D000ED95D /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 22C01BDE14626A2A00704D20 /* libstdc++.dylib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E17D0EC31B6F54DB000BC66B /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 2226CA23147362A900E4179C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 226182DE1463921B0021CA0D /* MyPageLogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyPageLogViewController.h; sourceTree = ""; }; + 226182DF1463921B0021CA0D /* MyPageLogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyPageLogViewController.m; sourceTree = ""; }; + 2275572514600461002FFD6B /* BaiduMobStatSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BaiduMobStatSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2275572914600461002FFD6B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 2275572B14600461002FFD6B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 2275572D14600461002FFD6B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 2275573114600461002FFD6B /* BaiduMobStatSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BaiduMobStatSample-Info.plist"; sourceTree = ""; }; + 2275573314600461002FFD6B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 2275573514600461002FFD6B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 2275573714600461002FFD6B /* BaiduMobStatSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BaiduMobStatSample-Prefix.pch"; sourceTree = ""; }; + 2275573814600461002FFD6B /* BaiduMobStatAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaiduMobStatAppDelegate.h; sourceTree = ""; }; + 2275573914600461002FFD6B /* BaiduMobStatAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaiduMobStatAppDelegate.m; sourceTree = ""; }; + 229683CC1468FD1500794E11 /* libz.1.2.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.5.dylib; path = usr/lib/libz.1.2.5.dylib; sourceTree = SDKROOT; }; + 22C01BDC1462697C00704D20 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; + 22C01BDE14626A2A00704D20 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; + 22E2C0BE14720BBE00917548 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 766EAE351522E7CB006A9109 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = ../icon.png; sourceTree = ""; }; + DA96D9231820E121005A9FEC /* BaiduMobStat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaiduMobStat.h; path = BaiduMobStatSample/BaiduMobStat.h; sourceTree = ""; }; + DAA49FA9172CC57600643216 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + DAA49FAB172CC5AB00643216 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; + E160B7031C31296A00371DFD /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + E17D0E9F1B6F4B77000BC66B /* libBaiduMobStat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libBaiduMobStat.a; sourceTree = ""; }; + E181D3ED1A232C6C00E67202 /* WebViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewViewController.h; sourceTree = ""; }; + E181D3EE1A232C6C00E67202 /* WebViewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewViewController.m; sourceTree = ""; }; + E19B3F821AB1707300B24474 /* mobstat.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = mobstat.js; sourceTree = ""; }; + E19B3F841AB1749C00B24474 /* mobstat.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = mobstat.html; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2275572214600461002FFD6B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E160B7041C31296A00371DFD /* JavaScriptCore.framework in Frameworks */, + E1C8D9161B6F5C9D000ED95D /* libstdc++.dylib in Frameworks */, + E1C8D9151B6F5C91000ED95D /* libz.1.2.5.dylib in Frameworks */, + DAA49FAA172CC57600643216 /* Security.framework in Frameworks */, + 2226CA24147362A900E4179C /* CoreLocation.framework in Frameworks */, + 22E2C0BF14720BBE00917548 /* SystemConfiguration.framework in Frameworks */, + 22C01BDD1462697C00704D20 /* CoreTelephony.framework in Frameworks */, + E17D0EA01B6F4B77000BC66B /* libBaiduMobStat.a in Frameworks */, + 2275572E14600461002FFD6B /* CoreGraphics.framework in Frameworks */, + 2275572A14600461002FFD6B /* UIKit.framework in Frameworks */, + 2275572C14600461002FFD6B /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2275571A14600461002FFD6B = { + isa = PBXGroup; + children = ( + DA96D9231820E121005A9FEC /* BaiduMobStat.h */, + E17D0E9F1B6F4B77000BC66B /* libBaiduMobStat.a */, + E17E36141A2449FA00054F9D /* WebDemo */, + 2275572F14600461002FFD6B /* BaiduMobStatSample */, + 2275572814600461002FFD6B /* Frameworks */, + 2275572614600461002FFD6B /* Products */, + ); + sourceTree = ""; + }; + 2275572614600461002FFD6B /* Products */ = { + isa = PBXGroup; + children = ( + 2275572514600461002FFD6B /* BaiduMobStatSample.app */, + ); + name = Products; + sourceTree = ""; + }; + 2275572814600461002FFD6B /* Frameworks */ = { + isa = PBXGroup; + children = ( + E160B7031C31296A00371DFD /* JavaScriptCore.framework */, + DAA49FA9172CC57600643216 /* Security.framework */, + 2226CA23147362A900E4179C /* CoreLocation.framework */, + 229683CC1468FD1500794E11 /* libz.1.2.5.dylib */, + 22E2C0BE14720BBE00917548 /* SystemConfiguration.framework */, + 22C01BDE14626A2A00704D20 /* libstdc++.dylib */, + 22C01BDC1462697C00704D20 /* CoreTelephony.framework */, + 2275572914600461002FFD6B /* UIKit.framework */, + 2275572B14600461002FFD6B /* Foundation.framework */, + 2275572D14600461002FFD6B /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 2275572F14600461002FFD6B /* BaiduMobStatSample */ = { + isa = PBXGroup; + children = ( + 2275573814600461002FFD6B /* BaiduMobStatAppDelegate.h */, + 2275573914600461002FFD6B /* BaiduMobStatAppDelegate.m */, + 226182DE1463921B0021CA0D /* MyPageLogViewController.h */, + 226182DF1463921B0021CA0D /* MyPageLogViewController.m */, + E181D3ED1A232C6C00E67202 /* WebViewViewController.h */, + E181D3EE1A232C6C00E67202 /* WebViewViewController.m */, + 2275573014600461002FFD6B /* Supporting Files */, + ); + path = BaiduMobStatSample; + sourceTree = ""; + }; + 2275573014600461002FFD6B /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 766EAE351522E7CB006A9109 /* icon.png */, + DAA49FAB172CC5AB00643216 /* Default-568h@2x.png */, + 2275573114600461002FFD6B /* BaiduMobStatSample-Info.plist */, + 2275573214600461002FFD6B /* InfoPlist.strings */, + 2275573514600461002FFD6B /* main.m */, + 2275573714600461002FFD6B /* BaiduMobStatSample-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + E17E36141A2449FA00054F9D /* WebDemo */ = { + isa = PBXGroup; + children = ( + E19B3F841AB1749C00B24474 /* mobstat.html */, + E19B3F821AB1707300B24474 /* mobstat.js */, + ); + path = WebDemo; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2275572414600461002FFD6B /* BaiduMobStatSample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2275573D14600462002FFD6B /* Build configuration list for PBXNativeTarget "BaiduMobStatSample" */; + buildPhases = ( + 2275572114600461002FFD6B /* Sources */, + 2275572214600461002FFD6B /* Frameworks */, + 2275572314600461002FFD6B /* Resources */, + E17D0EC31B6F54DB000BC66B /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BaiduMobStatSample; + productName = BaiduMobStatSample; + productReference = 2275572514600461002FFD6B /* BaiduMobStatSample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2275571C14600461002FFD6B /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + TargetAttributes = { + 2275572414600461002FFD6B = { + DevelopmentTeam = 3BJYKWHMM4; + SystemCapabilities = { + com.apple.Keychain = { + enabled = 0; + }; + }; + }; + }; + }; + buildConfigurationList = 2275571F14600461002FFD6B /* Build configuration list for PBXProject "BaiduMobStatSample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2275571A14600461002FFD6B; + productRefGroup = 2275572614600461002FFD6B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2275572414600461002FFD6B /* BaiduMobStatSample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2275572314600461002FFD6B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2275573414600461002FFD6B /* InfoPlist.strings in Resources */, + E19B3F851AB1749C00B24474 /* mobstat.html in Resources */, + 766EAE361522E7CB006A9109 /* icon.png in Resources */, + E19B3F831AB1707300B24474 /* mobstat.js in Resources */, + DAA49FAC172CC5AB00643216 /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2275572114600461002FFD6B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2275573614600461002FFD6B /* main.m in Sources */, + 2275573A14600461002FFD6B /* BaiduMobStatAppDelegate.m in Sources */, + E181D3EF1A232C6C00E67202 /* WebViewViewController.m in Sources */, + 226182E11463921B0021CA0D /* MyPageLogViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 2275573214600461002FFD6B /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 2275573314600461002FFD6B /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2275573B14600461002FFD6B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_INPUT_FILETYPE = automatic; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 2275573C14600461002FFD6B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_INPUT_FILETYPE = automatic; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2275573E14600462002FFD6B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer: 鍐啲 鏉 (37SMRZH562)"; + ENABLE_BITCODE = YES; + GCC_INPUT_FILETYPE = automatic; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BaiduMobStatSample/BaiduMobStatSample-Prefix.pch"; + INFOPLIST_FILE = "BaiduMobStatSample/BaiduMobStatSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "0ec318cc-28a5-41d0-99fc-481a9c0ed7e7"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 2275573F14600462002FFD6B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer: 鍐啲 鏉 (37SMRZH562)"; + ENABLE_BITCODE = YES; + GCC_INPUT_FILETYPE = automatic; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BaiduMobStatSample/BaiduMobStatSample-Prefix.pch"; + INFOPLIST_FILE = "BaiduMobStatSample/BaiduMobStatSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "0ec318cc-28a5-41d0-99fc-481a9c0ed7e7"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2275571F14600461002FFD6B /* Build configuration list for PBXProject "BaiduMobStatSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2275573B14600461002FFD6B /* Debug */, + 2275573C14600461002FFD6B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2275573D14600462002FFD6B /* Build configuration list for PBXNativeTarget "BaiduMobStatSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2275573E14600462002FFD6B /* Debug */, + 2275573F14600462002FFD6B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2275571C14600461002FFD6B /* Project object */; +} diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a063d8d --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStat.h b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStat.h new file mode 100644 index 0000000..a649015 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStat.h @@ -0,0 +1,212 @@ +// +// BaiduMobStat.h +// BaiduMobStat +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import +#import + +@class UIViewController; + +/** + * 鏃ュ織鍙戦佺瓥鐣 + */ +typedef enum _BaiduMobStatLogStrategy { + BaiduMobStatLogStrategyAppLaunch = 0, //姣忔绋嬪簭鍚姩鏃跺彂閫侊紙榛樿绛栫暐锛屾帹鑽愪娇鐢!锛 + BaiduMobStatLogStrategyDay = 1, //姣忓ぉ鐨勭▼搴忕涓娆¤繘鍏ュ惎鍔 + BaiduMobStatLogStrategyCustom = 2, //鏍规嵁璁惧畾鐨勬椂闂撮棿闅斿彂閫 +} BaiduMobStatLogStrategy; + +/** + * 鑷姩鐩戞帶绛栫暐 + * 鍚姩鑷姩鐩戞帶绛栫暐鍚庯紝鍘熷厛鐩稿簲璋冪敤Api鎵嬪姩鍩嬬偣鐨勪唬鐮侀渶瑕佸垹闄わ紝閬垮厤閲嶅缁熻锛侊紒 + * 涓句緥锛氬惎鍔˙aiduMobStatMonitorStrategyPageView绛栫暐锛屽垯涓嶉渶瑕佽皟鐢╬ageviewStartWithName绛夋帴鍙h繘琛岄〉闈㈢粺璁° + */ +typedef enum _BaiduMobStatMonitorStrategy { + BaiduMobStatMonitorStrategyNone = 0, //涓嶅惎鐢ㄨ嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyPageView = 1, //鍙惎鍔ㄩ〉闈㈢粺璁¤嚜鍔ㄧ洃鎺 + BaiduMobStatMonitorStrategyButton = 2, //鍙惎鍔╞utton缁熻鑷姩鐩戞帶 + BaiduMobStatMonitorStrategyAll = 3, //鍚姩椤甸潰缁熻涓巄utton缁熻鑷姩鐩戞帶 +} BaiduMobStatMonitorStrategy; + +/** + * 鐧惧害绉诲姩搴旂敤缁熻鎺ュ彛 + * 褰撳墠鐗堟湰 V3.7.2.0 + */ +@interface BaiduMobStat : NSObject + +/** + * 浠ヤ笅property灞炴э紝鍧囦负鍙夎缃 + */ + +/** + * 璁剧疆app鐨勭増鏈彿 + * 鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 + * 鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏 + */ +@property (nonatomic, copy) NSString *shortAppVersion; + +/** + * 璁剧疆娓犻亾Id + * 榛樿鍊间负 "AppStore" + */ +@property (nonatomic, copy) NSString *channelId; + +/** + * 鏄惁鍚敤Crash鏃ュ織鏀堕泦 + * 榛樿鍊 YES + */ +@property (nonatomic) BOOL enableExceptionLog; + +/** + * 鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL logSendWifiOnly; + +/** + * 璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s + * 渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 + * 榛樿鍊 30s + */ +@property (nonatomic) int sessionResumeInterval; + +/** + * 璁剧疆鏃ュ織鍙戦佺瓥鐣 + * 榛樿鍊 BaiduMobStatLogStrategyAppLaunch + */ +@property (nonatomic) BaiduMobStatLogStrategy logStrategy; + +/** + * 璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 + * 褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 + * 鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 + * 榛樿鍊间负 1 + */ +@property (nonatomic) int logSendInterval; + +/** + * 璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 + * 榛樿鍊 NO + */ +@property (nonatomic) BOOL enableDebugOn; + +/** + * 璁剧疆璁惧adid + * 鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ + * 榛樿鍊 绌哄瓧绗︿覆:@"" + */ +@property (nonatomic, copy) NSString *adid; + +/** + * 璁剧疆鑷姩鐩戞帶绛栫暐 + * 榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺 + */ +@property (nonatomic, assign) BaiduMobStatMonitorStrategy monitorStrategy; + +/** + * 鑾峰彇缁熻瀵硅薄鐨勫疄渚 + * + * @return 涓涓粺璁″璞″疄渚 + */ ++ (BaiduMobStat *)defaultStat; + +/** + * 璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 + * 娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆 + * + * @param appkey 鐢ㄦ埛鍦╩tj缃戠珯涓婂垱寤哄簲鐢紝鑾峰彇瀵瑰簲鐨刟ppKey + */ +- (void)startWithAppId:(NSString *)appKey; + +/** + * 璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + * @param duration 宸茬煡鐨勮嚜瀹氫箟浜嬩欢鏃堕暱锛屽崟浣嶄负姣锛坢s锛 + */ +- (void)logEventWithDurationTime:(NSString *)eventId eventLabel:(NSString *)eventLabel durationTime:(unsigned long)duration; + +/** + * 璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛 + * + * @param eventId 鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤 + * @param eventLabel 鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓 + */ +- (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewStartWithName:(NSString *)name; + +/** + * 璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 + * 寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢 + * + * @param name 椤甸潰鍚嶇О + */ +- (void)pageviewEndWithName:(NSString *)name; + +/** + * 璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 + * 鍦║IWebView鐨勪唬鐞嗘柟娉曪細 + * - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType + * 涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔 + * + * @param request UIWebView鐨勮姹傚弬鏁 + */ +- (void)webviewStartLoadWithRequest:(NSURLRequest *)request; + +/** + * 鑾峰彇cuid鐨勫 + * 杩斿洖SDK鐢熸垚鐨刢uid + * + * @return 璁惧Cuid + */ +- (NSString *)getDeviceCuid; + +@end + +/** + * Category 澹版槑 + */ +#define BAIDU_MOB_STAT_DEFINE_CATEGORY \ +@interface UIViewController (BaiduMobStatViewController) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@end \ +@interface UIWindow (BaiduMobStatWindow) \ +@end \ +@interface UIButton (BaiduMobStatButton) \ +@property (nonatomic, assign) BOOL baiduMobStatHandleRecord; \ +@property (nonatomic, strong) NSString *titleForBaiduMobStat; \ +@property (nonatomic, strong) NSString *labelForBaiduMobStat; \ +@end + +BAIDU_MOB_STAT_DEFINE_CATEGORY + + diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.h b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.h new file mode 100644 index 0000000..22d9863 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.h @@ -0,0 +1,15 @@ +// +// BaiduMobStatAppDelegate.h +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import + +@interface BaiduMobStatAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.m b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.m new file mode 100644 index 0000000..b50d483 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatAppDelegate.m @@ -0,0 +1,60 @@ +// +// BaiduMobStatAppDelegate.m +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import "BaiduMobStatAppDelegate.h" +#import "BaiduMobStat.h" +#import "MyPageLogViewController.h" + +@implementation BaiduMobStatAppDelegate + +/** + * 鍒濆鍖栫櫨搴︾粺璁DK + */ +- (void)startBaiduMobStat { + /*鑻ュ簲鐢ㄦ槸鍩轰簬iOS 9绯荤粺寮鍙戯紝闇瑕佸湪绋嬪簭鐨刬nfo.plist鏂囦欢涓坊鍔犱竴椤瑰弬鏁伴厤缃紝纭繚鏃ュ織姝e父鍙戦侊紝閰嶇疆濡備笅锛 + NSAppTransportSecurity(NSDictionary): + NSAllowsArbitraryLoads(Boolen):YES + 璇︽儏鍙傝冩湰Demo鐨凚aiduMobStatSample-Info.plist鏂囦欢涓殑閰嶇疆 + */ + BaiduMobStat* statTracker = [BaiduMobStat defaultStat]; + // 姝ゅ(startWithAppId涔嬪墠)鍙互璁剧疆鍒濆鍖栫殑鍙夊弬鏁帮紝鍏蜂綋鏈夊摢浜涘弬鏁帮紝鍙瑙丅aiduMobStat.h鏂囦欢锛屼緥濡傦細 + statTracker.shortAppVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; + statTracker.enableDebugOn = YES; + + [statTracker startWithAppId:@"3af6b6bd84"]; // 璁剧疆鎮ㄥ湪mtj缃戠珯涓婃坊鍔犵殑app鐨刟ppkey,姝ゅAppId鍗充负搴旂敤鐨刟ppKey +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // 鍒濆鍖栫櫨搴︾粺璁DK + [self startBaiduMobStat]; + + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + UITabBarController *tabbarController = [[UITabBarController alloc] init]; + MyPageLogViewController* v1 = [[MyPageLogViewController alloc] init]; + v1.title = @"Tab1"; + UINavigationController *nv1 = [[UINavigationController alloc] initWithRootViewController:v1]; + MyPageLogViewController* v2 = [[MyPageLogViewController alloc] init]; + v2.title = @"Tab2"; + UINavigationController *nv2 = [[UINavigationController alloc] initWithRootViewController:v2]; + MyPageLogViewController* v3 = [[MyPageLogViewController alloc] init]; + v3.title = @"Tab3"; + UINavigationController *nv3 = [[UINavigationController alloc] initWithRootViewController:v3]; + MyPageLogViewController* v4 = [[MyPageLogViewController alloc] init]; + v4.title = @"Tab4"; + UINavigationController *nv4 = [[UINavigationController alloc] initWithRootViewController:v4]; + NSArray* items =[NSArray arrayWithObjects:nv1, nv2, nv3, nv4, nil]; + tabbarController.viewControllers = items; + tabbarController.delegate = self; + self.window.backgroundColor = [UIColor whiteColor]; + self.window.rootViewController = tabbarController; + [self.window makeKeyAndVisible]; + + return YES; +} + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Info.plist b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Info.plist new file mode 100644 index 0000000..5709962 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + 鐧惧害绉诲姩缁熻 + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + icon.png + + CFBundleIdentifier + com.baidu.hmtj + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSLocationAlwaysUsageDescription + + NSLocationWhenInUseDescription + YES + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Prefix.pch b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Prefix.pch new file mode 100644 index 0000000..0a0aa91 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/BaiduMobStatSample-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header for all source files of the 'BaiduMobStatSample' target in the 'BaiduMobStatSample' project +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif + +#define BAIDU_DEBUG_MODE \ No newline at end of file diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.h b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.h new file mode 100644 index 0000000..39436a2 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.h @@ -0,0 +1,15 @@ +// +// MyPageLogViewController.h +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import + +@interface MyPageLogViewController : UIViewController { + BOOL eventStatu; +} + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.m b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.m new file mode 100644 index 0000000..39f8b72 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/MyPageLogViewController.m @@ -0,0 +1,171 @@ +// +// MyPageLogViewController.m +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import "MyPageLogViewController.h" +#import "BaiduMobStat.h" +#import "WebViewViewController.h" + +@implementation MyPageLogViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + NSString* cName = [NSString stringWithFormat:@"%@", self.tabBarItem.title, nil]; + [[BaiduMobStat defaultStat] pageviewStartWithName:cName]; + +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + NSString* cName = [NSString stringWithFormat:@"%@", self.tabBarItem.title, nil]; + [[BaiduMobStat defaultStat] pageviewEndWithName:cName]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.navigationController.navigationBar.translucent = NO; + float y = 10.0; + UILabel *label0 = [[UILabel alloc] initWithFrame:CGRectMake(0, y, 150, 25)]; + label0.backgroundColor = [UIColor grayColor]; + label0.textColor = [UIColor whiteColor]; + label0.text = @"鑷畾涔変簨浠剁粺璁"; + label0.font = [UIFont systemFontOfSize:13]; + label0.textAlignment = NSTextAlignmentCenter; + [self.view addSubview:label0]; + y += 35; + + UIButton* btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btn1.frame = CGRectMake(0, y, 160, 25); + [btn1 setTitle:@"Event1" forState:UIControlStateNormal]; + [btn1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + btn1.titleLabel.textAlignment = NSTextAlignmentLeft; + [btn1 addTarget:self action:@selector(logEventClick:) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:btn1]; + y += 35; + + UIButton* btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btn2.frame = CGRectMake(0, y, 160, 25); + [btn2 setTitle:@"Event2 Start" forState:UIControlStateNormal]; + [btn2 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + btn2.titleLabel.textAlignment = NSTextAlignmentLeft; + [btn2 addTarget:self action:@selector(logEventWithDurationTime:) forControlEvents: UIControlEventTouchUpInside]; + [self.view addSubview:btn2]; + y += 35; + + UIButton* btn3 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btn3.frame = CGRectMake(0, y, 160, 25); + [btn3 setTitle:@"Event3 (duration 1s)" forState:UIControlStateNormal]; + [btn3 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + btn3.titleLabel.textAlignment = NSTextAlignmentLeft; + [btn3 addTarget:self action:@selector(logEventWithOneSeconde:) forControlEvents: UIControlEventTouchUpInside]; + [self.view addSubview:btn3]; + y += 35; + + if ([self.title isEqualToString:@"Tab1"]) { + UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, y, 150, 25)]; + label1.backgroundColor = [UIColor grayColor]; + label1.textColor = [UIColor whiteColor]; + label1.text = @"webView琛屼负缁熻"; + label1.textAlignment = NSTextAlignmentCenter; + label1.font = [UIFont systemFontOfSize:13]; + [self.view addSubview:label1]; + y += 30; + + UIButton* btn4 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btn4.frame = CGRectMake(0, y, 160, 25); + [btn4 setTitle:@"Into WebView" forState:UIControlStateNormal]; + [btn4 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + btn4.titleLabel.textAlignment = NSTextAlignmentLeft; + [btn4 addTarget:self action:@selector(intoWebView:) forControlEvents: UIControlEventTouchUpInside]; + [self.view addSubview:btn4]; + y += 35; + } + + UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, y, 150, 25)]; + label2.backgroundColor = [UIColor grayColor]; + label2.textColor = [UIColor whiteColor]; + label2.text = @"椤甸潰缁熻"; + label2.textAlignment = NSTextAlignmentCenter; + label2.font = [UIFont systemFontOfSize:13]; + [self.view addSubview:label2]; + y += 30; + + UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(0, y, 150, 25)]; + label3.backgroundColor = [UIColor clearColor]; + label3.textColor = [UIColor grayColor]; + label3.text = @"鍒囨崲Tab缁熻椤甸潰"; + label3.textAlignment = NSTextAlignmentCenter; + label3.font = [UIFont systemFontOfSize:14]; + [self.view addSubview:label3]; + y += 30; + + UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(0, y, 150, 25)]; + label4.backgroundColor = [UIColor grayColor]; + label4.textColor = [UIColor whiteColor]; + label4.text = @"Exception缁熻"; + label4.textAlignment = NSTextAlignmentCenter; + label4.font = [UIFont systemFontOfSize:13]; + [self.view addSubview:label4]; + y += 30; + + UIButton* btn5 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btn5.frame = CGRectMake(0, y, 160, 25); + [btn5 setTitle:@"瑙﹀彂寮傚父宕╂簝" forState:UIControlStateNormal]; + [btn5 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + btn5.titleLabel.textAlignment = NSTextAlignmentLeft; + [btn5 addTarget:self action:@selector(makeException:) forControlEvents: UIControlEventTouchUpInside]; + [self.view addSubview:btn5]; + y += 60; + +} + +- (void)logEventClick:(id)sender { + [[BaiduMobStat defaultStat] logEvent:@"Event1" eventLabel:@"sss"]; +} + +- (void)logEventWithDurationTime:(id)sender { + if(!eventStatu) { + eventStatu = YES; + [(UIButton*) sender setTitle:@"Event2 End" forState:UIControlStateNormal]; + + [[BaiduMobStat defaultStat] eventStart:@"Event2" eventLabel:@"sss"]; + } else { + eventStatu = NO; + [(UIButton*) sender setTitle:@"Event2 Start" forState:UIControlStateNormal]; + + [[BaiduMobStat defaultStat] eventEnd:@"Event2" eventLabel:@"sss"]; + } +} + +- (void)logEventWithOneSeconde:(id)sender { + [[BaiduMobStat defaultStat] logEventWithDurationTime:@"Event3" eventLabel:@"sss" durationTime:1000]; +} + +- (void)intoWebView:(id)sender { + WebViewViewController * webC = [[WebViewViewController alloc] init]; + [self.navigationController pushViewController:webC animated:YES]; +} + +- (void)makeException:(id)sender { + NSArray *array1 = [[NSArray alloc] initWithObjects:@"1", nil]; + [array1 objectAtIndex:2]; +} + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.h b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.h new file mode 100644 index 0000000..4cf7743 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.h @@ -0,0 +1,13 @@ +// +// WebViewViewController.h +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import + +@interface WebViewViewController : UIViewController + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.m b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.m new file mode 100644 index 0000000..ec3cd4a --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/WebViewViewController.m @@ -0,0 +1,44 @@ +// +// WebViewViewController.m +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import "WebViewViewController.h" +#import "BaiduMobStat.h" + + +@interface WebViewViewController () + +@end + +@implementation WebViewViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + UIWebView * Web = [[UIWebView alloc] init]; + Web.delegate = self; + Web.frame = CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height); + Web.autoresizingMask = UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight; + [self.view addSubview:Web]; + + NSString *filePath = [[NSBundle mainBundle]pathForResource:@"mobstat" ofType:@"html"]; + NSURL *url = [NSURL fileURLWithPath:filePath]; + NSURLRequest *request = [NSURLRequest requestWithURL:url]; + [Web loadRequest:request]; +} + +//瀹炵幇WebView鐨勪唬鐞嗘柟娉曪紝骞跺湪姝ゅ嚱鏁颁腑璋冪敤SDK鐨剋ebviewStartLoadWithRequest:浼犲叆request鍙傛暟锛岃繘琛岀粺璁 +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { + [[BaiduMobStat defaultStat] webviewStartLoadWithRequest:request]; + return YES; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/en.lproj/InfoPlist.strings b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/main.m b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/main.m new file mode 100644 index 0000000..86a248b --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/BaiduMobStatSample/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BaiduMobStatSample +// +// Created by Lidongdong on 15/7/22. +// Copyright (c) 2015骞 Baidu. All rights reserved. +// + +#import + +#import "BaiduMobStatAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BaiduMobStatAppDelegate class])); + } +} diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/Default-568h@2x.png b/BaiduMTJ/ios_demo/BaiduMobStatDemo/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/BaiduMTJ/ios_demo/BaiduMobStatDemo/Default-568h@2x.png differ diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.html b/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.html new file mode 100755 index 0000000..8c2e01b --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.html @@ -0,0 +1,29 @@ + + + + + Mob Stat Test + + + + + +

BaiduMobStat

+ + + diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.js b/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.js new file mode 100755 index 0000000..a53d2a4 --- /dev/null +++ b/BaiduMTJ/ios_demo/BaiduMobStatDemo/WebDemo/mobstat.js @@ -0,0 +1,74 @@ +var BaiduMobStat = (function() { + var invokeNatvieMethod = function(action, obj) { + console.info("invokeNatvieMethod"); + + // call native method + var cmd = { + action: action, + obj: obj + } + + var iFrame = document.createElement("iframe"); + iFrame.setAttribute("src", "bmtj:" + JSON.stringify(cmd)); + iFrame.setAttribute("style", "display:none;"); + iFrame.setAttribute("height", "0px"); + iFrame.setAttribute("width", "0px"); + iFrame.setAttribute("frameborder", "0"); + + document.body.appendChild(iFrame); + + // 鍙戣捣璇锋眰鍚庤繖涓猧Frame灏辨病鐢ㄤ簡锛屾墍浠ユ妸瀹冧粠dom涓婄Щ闄ゆ帀 + iFrame.parentNode.removeChild(iFrame); + iFrame = null; + } + + return { + onPageStart: function(page) { + var obj = { + page: page + }; + + invokeNatvieMethod('onPageStart', obj); + }, + onPageEnd: function(page) { + var obj = { + page: page + }; + + invokeNatvieMethod('onPageEnd', obj); + }, + onEvent: function(id, label) { + var obj = { + event_id: id, + label: label, + }; + + invokeNatvieMethod('onEvent', obj); + }, + onEventStart: function(id, label) { + var obj = { + event_id: id, + label: label + }; + + invokeNatvieMethod('onEventStart', obj); + }, + onEventEnd: function(id, label) { + var obj = { + event_id: id, + label: label + }; + + invokeNatvieMethod('onEventEnd', obj); + }, + onEventDuration: function(id, label, duration) { + var obj = { + event_id: id, + label: label, + duration: typeof duration === 'number' ? duration : 0 + }; + + invokeNatvieMethod('onEventDuration', obj); + } + }; +}()); \ No newline at end of file diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/icon.png b/BaiduMTJ/ios_demo/BaiduMobStatDemo/icon.png new file mode 100644 index 0000000..1e1f189 Binary files /dev/null and b/BaiduMTJ/ios_demo/BaiduMobStatDemo/icon.png differ diff --git a/BaiduMTJ/ios_demo/BaiduMobStatDemo/libBaiduMobStat.a b/BaiduMTJ/ios_demo/BaiduMobStatDemo/libBaiduMobStat.a new file mode 100644 index 0000000..3863176 Binary files /dev/null and b/BaiduMTJ/ios_demo/BaiduMobStatDemo/libBaiduMobStat.a differ diff --git a/BaiduMTJ/ios_doc/Categories/UIViewController+BaiduMobStatViewController.html b/BaiduMTJ/ios_doc/Categories/UIViewController+BaiduMobStatViewController.html new file mode 100644 index 0000000..cc848e3 --- /dev/null +++ b/BaiduMTJ/ios_doc/Categories/UIViewController+BaiduMobStatViewController.html @@ -0,0 +1,223 @@ + + + + + UIViewController(BaiduMobStatViewController) Category Reference + + + + + + +
+ + + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inBaiduMobStat.h
+ + + + +
+ +

Overview

+

Category 澹版槑

+
+ + + + + + + + + + + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/BaiduMTJ/ios_doc/Classes/BaiduMobStat.html b/BaiduMTJ/ios_doc/Classes/BaiduMobStat.html new file mode 100644 index 0000000..ff849d3 --- /dev/null +++ b/BaiduMTJ/ios_doc/Classes/BaiduMobStat.html @@ -0,0 +1,1465 @@ + + + + + BaiduMobStat Class Reference + + + + + + +
+ + + + +
+ +
+
+ + + +
+ +
+ + + + + + + +
Inherits fromNSObject
Declared inBaiduMobStat.h
+ + + + +
+ +

Overview

+

鐧惧害绉诲姩搴旂敤缁熻鎺ュ彛 +褰撳墠鐗堟湰 V3.7.2.0

+
+ + + + + +
+ +

Tasks

+ + + + + + + +
+ + + + + +
+ +

Properties

+ +
+ +

adid

+ + + +
+

璁剧疆璁惧adid +鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ +榛樿鍊 绌哄瓧绗︿覆:@“”

+
+ + + +
@property (nonatomic, copy) NSString *adid
+ + + + + + + + + +
+

Discussion

+

璁剧疆璁惧adid +鑻ユ湁闇瑕侊紝寮鍙戣呭彲鑷鑾峰彇鍒癮did鍚庝紶鍏ワ紝浣跨粺璁℃洿绮剧‘ +榛樿鍊 绌哄瓧绗︿覆:@“”

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

channelId

+ + + +
+

璁剧疆娓犻亾Id +榛樿鍊间负 “AppStore”

+
+ + + +
@property (nonatomic, copy) NSString *channelId
+ + + + + + + + + +
+

Discussion

+

璁剧疆娓犻亾Id +榛樿鍊间负 “AppStore”

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

enableDebugOn

+ + + +
+

璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 +榛樿鍊 NO

+
+ + + +
@property (nonatomic) BOOL enableDebugOn
+ + + + + + + + + +
+

Discussion

+

璁剧疆鏄惁鎵撳嵃SDK涓殑鏃ュ織锛岀敤浜庤皟璇 +榛樿鍊 NO

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

enableExceptionLog

+ + + +
+

鏄惁鍚敤Crash鏃ュ織鏀堕泦 +榛樿鍊 YES

+
+ + + +
@property (nonatomic) BOOL enableExceptionLog
+ + + + + + + + + +
+

Discussion

+

鏄惁鍚敤Crash鏃ュ織鏀堕泦 +榛樿鍊 YES

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

logSendInterval

+ + + +
+

璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 +褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 +鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 +榛樿鍊间负 1

+
+ + + +
@property (nonatomic) int logSendInterval
+ + + + + + + + + +
+

Discussion

+

璁剧疆鏃ュ織鍙戦佹椂闂撮棿闅 +褰搇ogStrategy璁剧疆涓築aiduMobStatLogStrategyCustom鏃剁敓鏁 +鍗曚綅涓哄皬鏃讹紝鏈夋晥鍊间负1~24 +榛樿鍊间负 1

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

logSendWifiOnly

+ + + +
+

鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 +榛樿鍊 NO

+
+ + + +
@property (nonatomic) BOOL logSendWifiOnly
+ + + + + + + + + +
+

Discussion

+

鏄惁浠呭湪wifi缃戠粶鐘舵佷笅鎵嶅彂閫佹棩蹇 +榛樿鍊 NO

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

logStrategy

+ + + +
+

璁剧疆鏃ュ織鍙戦佺瓥鐣 +榛樿鍊 BaiduMobStatLogStrategyAppLaunch

+
+ + + +
@property (nonatomic) BaiduMobStatLogStrategy logStrategy
+ + + + + + + + + +
+

Discussion

+

璁剧疆鏃ュ織鍙戦佺瓥鐣 +榛樿鍊 BaiduMobStatLogStrategyAppLaunch

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

monitorStrategy

+ + + +
+

璁剧疆鑷姩鐩戞帶绛栫暐 +榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺

+
+ + + +
@property (nonatomic, assign) BaiduMobStatMonitorStrategy monitorStrategy
+ + + + + + + + + +
+

Discussion

+

璁剧疆鑷姩鐩戞帶绛栫暐 +榛樿鍊 BaiduMobStatMonitorStrategyNone 涓嶅惎鍔ㄨ嚜鍔ㄧ洃鎺

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

sessionResumeInterval

+ + + +
+

璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s +渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 +榛樿鍊 30s

+
+ + + +
@property (nonatomic) int sessionResumeInterval
+ + + + + + + + + +
+

Discussion

+

璁剧疆搴旂敤杩涘叆鍚庡彴鍐嶅洖鍒板墠鍙颁负鍚屼竴娆″惎鍔ㄧ殑鏈澶ч棿闅旀椂闂达紝鏈夋晥鍊艰寖鍥0锝600s +渚嬪璁剧疆鍊30s锛屽垯搴旂敤杩涘叆鍚庡彴鍚庯紝30s鍐呭敜閱掍负鍚屼竴娆″惎鍔 +榛樿鍊 30s

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

shortAppVersion

+ + + +
+

璁剧疆app鐨勭増鏈彿 +鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 +鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏

+
+ + + +
@property (nonatomic, copy) NSString *shortAppVersion
+ + + + + + + + + +
+

Discussion

+

璁剧疆app鐨勭増鏈彿 +鐢变簬鍏煎鍘嗗彶Xcode3宸ョ▼鐨勫師鍥狅紝榛樿鍊 鍙朇FBundleVersion涓殑鐗堟湰鍙 +鑻ヨ缁熻CFBundleShortVersionString涓殑鐗堟湰鍙凤紙鍗充笌AppStore涓婁竴鑷寸殑鐗堟湰鍙凤級锛屽彲鑷鑾峰彇鍚庝紶鍏

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ + + +
+ +

Class Methods

+ +
+ +

defaultStat

+ + + +
+

鑾峰彇缁熻瀵硅薄鐨勫疄渚

+
+ + + +
+ (BaiduMobStat *)defaultStat
+ + + + + +
+

Return Value

+

涓涓粺璁″璞″疄渚

+
+ + + + + +
+

Discussion

+

鑾峰彇缁熻瀵硅薄鐨勫疄渚

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ + + +
+ +

Instance Methods

+ +
+ +

eventEnd:eventLabel:

+ + + +
+

璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + +
- (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel
+ + + +
+

Parameters

+ +
+
eventId
+

鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤

+
+ +
+
eventLabel
+

鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍涓娆′簨浠剁殑缁撴潫锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

eventStart:eventLabel:

+ + + +
+

璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + +
- (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel
+ + + +
+

Parameters

+ +
+
eventId
+

鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤

+
+ +
+
eventLabel
+

鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍涓娆′簨浠剁殑寮濮嬶紝eventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

getDeviceCuid

+ + + +
+

鑾峰彇cuid鐨勫 +杩斿洖SDK鐢熸垚鐨刢uid

+
+ + + +
- (NSString *)getDeviceCuid
+ + + + + +
+

Return Value

+

璁惧Cuid

+
+ + + + + +
+

Discussion

+

鑾峰彇cuid鐨勫 +杩斿洖SDK鐢熸垚鐨刢uid

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

logEvent:eventLabel:

+ + + +
+

璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + +
- (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel
+ + + +
+

Parameters

+ +
+
eventId
+

鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤

+
+ +
+
eventLabel
+

鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍涓娆′簨浠剁殑鐐瑰嚮锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

logEventWithDurationTime:eventLabel:durationTime:

+ + + +
+

璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + +
- (void)logEventWithDurationTime:(NSString *)eventId eventLabel:(NSString *)eventLabel durationTime:(unsigned long)duration
+ + + +
+

Parameters

+ +
+
eventId
+

鑷畾涔変簨浠禝d锛屾彁鍓嶅湪缃戠珯绔垱寤

+
+ +
+
eventLabel
+

鑷畾涔変簨浠禠abel锛岄檮鍔犲弬鏁帮紝涓嶈兘涓虹┖瀛楃涓

+
+ +
+
duration
+

宸茬煡鐨勮嚜瀹氫箟浜嬩欢鏃堕暱锛屽崟浣嶄负姣锛坢s锛

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍涓娆′簨浠剁殑鏃堕暱锛宔ventId璇峰湪缃戠珯涓婂垱寤恒傛湭鍒涘缓鐨別venId璁板綍灏嗘棤鏁堛

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

pageviewEndWithName:

+ + + +
+

璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 +寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢

+
+ + + +
- (void)pageviewEndWithName:(NSString *)name
+ + + +
+

Parameters

+ +
+
name
+

椤甸潰鍚嶇О

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍鏌愪釜椤甸潰璁块棶鐨勭粨鏉燂紝涓巔ageviewStartWithName閰嶅浣跨敤锛岃鍙傝Example绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 +寤鸿鍦╒iewController鐨剉iewDidDisappear鍑芥暟涓皟鐢

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

pageviewStartWithName:

+ + + +
+

璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 +寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢

+
+ + + +
- (void)pageviewStartWithName:(NSString *)name
+ + + +
+

Parameters

+ +
+
name
+

椤甸潰鍚嶇О

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍鏌愪釜椤甸潰璁块棶鐨勫紑濮嬶紝璇峰弬瑙丒xample绋嬪簭锛屽湪鍚堥傜殑浣嶇疆璋冪敤銆 +寤鸿鍦╒iewController鐨剉iewDidAppear鍑芥暟涓皟鐢

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

startWithAppId:

+ + + +
+

璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 +娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆

+
+ + + +
- (void)startWithAppId:(NSString *)appKey
+ + + +
+

Parameters

+ +
+
appkey
+

鐢ㄦ埛鍦╩tj缃戠珯涓婂垱寤哄簲鐢紝鑾峰彇瀵瑰簲鐨刟ppKey

+
+ +
+ + + + + + + +
+

Discussion

+

璁剧疆搴旂敤鐨刟ppkey锛屽惎鍔ㄧ粺璁DK銆 +娉ㄦ剰锛侊紒锛佷互涓嬭涓篈pi璋冪敤鍓嶏紝蹇呴』鍏堣皟鐢ㄨ鎺ュ彛銆

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ +

webviewStartLoadWithRequest:

+ + + +
+

璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 +鍦║IWebView鐨勪唬鐞嗘柟娉曪細 +- (BOOL)webView:(UIWebView )webView shouldStartLoadWithRequest:(NSURLRequest )request navigationType:(UIWebViewNavigationType)navigationType +涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔

+
+ + + +
- (void)webviewStartLoadWithRequest:(NSURLRequest *)request
+ + + +
+

Parameters

+ +
+
request
+

UIWebView鐨勮姹傚弬鏁

+
+ +
+ + + + + + + +
+

Discussion

+

璁板綍UIWebView涓殑琛屼负锛堥渶瑕佸湪缃戦〉鐨凧S浠g爜涓繘琛岀浉搴旈厤缃紝璇﹁鏂囨。涓嶥emo绋嬪簭锛 +鍦║IWebView鐨勪唬鐞嗘柟娉曪細 +- (BOOL)webView:(UIWebView )webView shouldStartLoadWithRequest:(NSURLRequest )request navigationType:(UIWebViewNavigationType)navigationType +涓紝璋冪敤姝ゆ帴鍙o紝浼犲叆request鍙傛暟锛屽紑濮嬬粺璁S涓殑鎿嶄綔

+
+ + + + + + + +
+

Declared In

+ BaiduMobStat.h
+
+ + +
+ +
+ + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/BaiduMTJ/ios_doc/css/styles.css b/BaiduMTJ/ios_doc/css/styles.css new file mode 100644 index 0000000..3308189 --- /dev/null +++ b/BaiduMTJ/ios_doc/css/styles.css @@ -0,0 +1,615 @@ +body { + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + font-size: 13px; +} + +code { + font-family: Courier, Consolas, monospace; + font-size: 13px; + color: #666; +} + +pre { + font-family: Courier, Consolas, monospace; + font-size: 13px; + line-height: 18px; + tab-interval: 0.5em; + border: 1px solid #C7CFD5; + background-color: #F1F5F9; + color: #666; + padding: 0.3em 1em; +} + +ul { + list-style-type: square; +} + +li { + margin-bottom: 10px; +} + +a, a code { + text-decoration: none; + color: #36C; +} + +a:hover, a:hover code { + text-decoration: underline; + color: #36C; +} + +h2 { + border-bottom: 1px solid #8391A8; + color: #3C4C6C; + font-size: 187%; + font-weight: normal; + margin-top: 1.75em; + padding-bottom: 2px; +} + +table { + margin-bottom: 4em; + border-collapse:collapse; + vertical-align: middle; +} + +td { + border: 1px solid #9BB3CD; + padding: .667em; + font-size: 100%; +} + +th { + border: 1px solid #9BB3CD; + padding: .3em .667em .3em .667em; + background: #93A5BB; + font-size: 103%; + font-weight: bold; + color: white; + text-align: left; +} + +/* @group Common page elements */ + +#top_header { + height: 91px; + left: 0; + min-width: 598px; + position: absolute; + right: 0; + top: 0; + z-index: 900; +} + +#footer { + clear: both; + padding-top: 20px; + text-align: center; +} + +#contents, #overview_contents { + -webkit-overflow-scrolling: touch; + border-top: 1px solid #A9A9A9; + position: absolute; + top: 90px; + left: 0; + right: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + padding-left: 2em; + padding-right: 2em; + padding-top: 1em; + min-width: 550px; +} + +#contents.isShowingTOC { + left: 230px; + min-width: 320px; +} + +.copyright { + font-size: 12px; +} + +.generator { + font-size: 11px; +} + +.main-navigation ul li { + display: inline; + margin-left: 15px; + list-style: none; +} + +.navigation-top { + clear: both; + float: right; +} + +.navigation-bottom { + clear: both; + float: right; + margin-top: 20px; + margin-bottom: -10px; +} + +.open > .disclosure { + background-image: url("../img/disclosure_open.png"); +} + +.disclosure { + background: url("../img/disclosure.png") no-repeat scroll 0 0; +} + +.disclosure, .nodisclosure { + display: inline-block; + height: 8px; + margin-right: 5px; + position: relative; + width: 9px; +} + +/* @end */ + +/* @group Header */ + +#top_header #library { + background: url("../img/library_background.png") repeat-x 0 0 #485E78; + background-color: #ccc; + height: 35px; + font-size: 115%; +} + +#top_header #library #libraryTitle { + color: #FFFFFF; + margin-left: 15px; + text-shadow: 0 -1px 0 #485E78; + top: 8px; + position: absolute; +} + +#libraryTitle { + left: 0; +} + +#top_header #library #developerHome { + color: #92979E; + right: 15px; + top: 8px; + position: absolute; +} + +#top_header #library a:hover { + text-decoration: none; +} + +#top_header #title { + background: url("../img/title_background.png") repeat-x 0 0 #8A98A9; + border-bottom: 1px solid #757575; + height: 25px; + overflow: hidden; +} + +#top_header h1 { + font-size: 105%; + font-weight: normal; + margin: 0; + padding: 3px 0 2px; + text-align: center; + /*text-shadow: 0 1px 0 #D5D5D5;*/ + white-space: nowrap; +} + +#headerButtons { + background-color: #D8D8D8; + background-image: url("../img/button_bar_background.png"); + border-bottom: 0px solid #EDEDED; + border-top: 0px solid #a8a8a8; + font-size: 8pt; + height: 28px; + left: 0; + list-style: none outside none; + margin: 0; + overflow: hidden; + padding: 0; + position: absolute; + right: 0; + top: 61px; +} + +#headerButtons li { + background-repeat: no-repeat; + display: inline; + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +#toc_button button { + background-color: #EBEEF1; + border-color: #ACACAC; + border-style: none solid none none; + border-width: 0 1px 0 0; + height: 28px; + margin: 0; + padding-left: 30px; + text-align: left; + width: 230px; +} + +li#jumpto_button { + left: 230px; + margin-left: 0; + position: absolute; +} + +li#jumpto_button select { + height: 22px; + margin: 5px 2px 0 10px; + max-width: 300px; +} + +/* @end */ + +/* @group Table of contents */ + +#tocContainer.isShowingTOC { + border-right: 1px solid #ACACAC; + display: block; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} + +#tocContainer { + background-color: #EBEEF1; + border-top: 1px solid #ACACAC; + bottom: 0; + display: none; + left: 0; + overflow: hidden; + position: absolute; + top: 90px; + width: 229px; +} + +#tocContainer > ul#toc { + font-size: 11px; + margin: 0; + padding: 12px 0 18px; + width: 209px; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +#tocContainer > ul#toc > li { + margin: 0; + padding: 0 0 7px 30px; + text-indent: -15px; +} + +#tocContainer > ul#toc > li > .sectionName a { + color: #000000; + font-weight: bold; +} + +#tocContainer > ul#toc > li > .sectionName a:hover { + text-decoration: none; +} + +#tocContainer > ul#toc li.children > ul { + display: none; + height: 0; +} + +#tocContainer > ul#toc > li > ul { + margin: 0; + padding: 0; +} + +#tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { + margin-left: 0; + margin-bottom: 0; + padding-left: 15px; +} + +#tocContainer > ul#toc > li ul { + list-style: none; + margin-right: 0; + padding-right: 0; +} + +#tocContainer > ul#toc li.children.open > ul { + display: block; + height: auto; + margin-left: -15px; + padding-left: 0; +} + +#tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { + margin-left: 0; + padding-left: 15px; +} + +#tocContainer li ul li { + margin-top: 0.583em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#tocContainer li ul li span.sectionName { + white-space: normal; +} + +#tocContainer > ul#toc > li > ul > li > .sectionName a { + font-weight: bold; +} + +#tocContainer > ul#toc > li > ul a { + color: #4F4F4F; +} + +/* @end */ + +/* @group Index formatting */ + +.index-title { + font-size: 13px; + font-weight: normal; +} + +.index-column { + float: left; + width: 30%; + min-width: 200px; + font-size: 11px; +} + +.index-column ul { + margin: 8px 0 0 0; + padding: 0; + list-style: none; +} + +.index-column ul li { + margin: 0 0 3px 0; + padding: 0; +} + +.hierarchy-column { + min-width: 400px; +} + +.hierarchy-column ul { + margin: 3px 0 0 15px; +} + +.hierarchy-column ul li { + list-style-type: square; +} + +/* @end */ + +/* @group Common formatting elements */ + +.title { + font-weight: normal; + font-size: 215%; + margin-top:0; +} + +.subtitle { + font-weight: normal; + font-size: 180%; + color: #3C4C6C; + border-bottom: 1px solid #5088C5; +} + +.subsubtitle { + font-weight: normal; + font-size: 145%; + height: 0.7em; +} + +.note { + border: 1px solid #5088C5; + background-color: white; + margin: 1.667em 0 1.75em 0; + padding: 0 .667em .083em .750em; +} + +.warning { + border: 1px solid #5088C5; + background-color: #F0F3F7; + margin-bottom: 0.5em; + padding: 0.3em 0.8em; +} + +.bug { + border: 1px solid #000; + background-color: #ffffcc; + margin-bottom: 0.5em; + padding: 0.3em 0.8em; +} + +.deprecated { + color: #F60425; +} + +/* @end */ + +/* @group Common layout */ + +.section { + margin-top: 3em; +} + +/* @end */ + +/* @group Object specification section */ + +.section-specification { + margin-left: 2.5em; + margin-right: 2.5em; + font-size: 12px; +} + +.section-specification table { + margin-bottom: 0em; + border-top: 1px solid #d6e0e5; +} + +.section-specification td { + vertical-align: top; + border-bottom: 1px solid #d6e0e5; + border-left-width: 0px; + border-right-width: 0px; + border-top-width: 0px; + padding: .6em; +} + +.section-specification .specification-title { + font-weight: bold; +} + +/* @end */ + +/* @group Tasks section */ + +.task-list { + list-style-type: none; + padding-left: 0px; +} + +.task-list li { + margin-bottom: 3px; +} + +.task-item-suffix { + color: #996; + font-size: 12px; + font-style: italic; + margin-left: 0.5em; +} + +span.tooltip span.tooltip { + font-size: 1.0em; + display: none; + padding: 0.3em; + border: 1px solid #aaa; + background-color: #fdfec8; + color: #000; + text-align: left; +} + +span.tooltip:hover span.tooltip { + display: block; + position: absolute; + margin-left: 2em; +} + +/* @end */ + +/* @group Method section */ + +.section-method { + margin-top: 2.3em; +} + +.method-title { + margin-bottom: 1.5em; +} + +.method-subtitle { + margin-top: 0.7em; + margin-bottom: 0.2em; +} + +.method-subsection p { + margin-top: 0.4em; + margin-bottom: 0.8em; +} + +.method-declaration { + margin-top:1.182em; + margin-bottom:.909em; +} + +.method-declaration code { + font:14px Courier, Consolas, monospace; + color:#000; +} + +.declaration { + color: #000; +} + +.termdef { + margin-bottom: 10px; + margin-left: 0px; + margin-right: 0px; + margin-top: 0px; +} + +.termdef dt { + margin: 0; + padding: 0; +} + +.termdef dd { + margin-bottom: 6px; + margin-left: 16px; + margin-right: 0px; + margin-top: 1px; +} + +.termdef dd p { + margin-bottom: 6px; + margin-left: 0px; + margin-right: 0px; + margin-top: -1px; +} + +.argument-def { + margin-top: 0.3em; + margin-bottom: 0.3em; +} + +.argument-def dd { + margin-left: 1.25em; +} + +.see-also-section ul { + list-style-type: none; + padding-left: 0px; + margin-top: 0; +} + +.see-also-section li { + margin-bottom: 3px; +} + +.declared-in-ref { + color: #666; +} + +#tocContainer.hideInXcode { + display: none; + border: 0px solid black; +} + +#top_header.hideInXcode { + display: none; +} + +#contents.hideInXcode { + border: 0px solid black; + top: 0px; + left: 0px; +} + +/* @end */ + diff --git a/BaiduMTJ/ios_doc/css/stylesPrint.css b/BaiduMTJ/ios_doc/css/stylesPrint.css new file mode 100644 index 0000000..dc54cd2 --- /dev/null +++ b/BaiduMTJ/ios_doc/css/stylesPrint.css @@ -0,0 +1,22 @@ + +header { + display: none; +} + +div.main-navigation, div.navigation-top { + display: none; +} + +div#overview_contents, div#contents.isShowingTOC, div#contents { + overflow: visible; + position: relative; + top: 0px; + border: none; + left: 0; +} +#tocContainer.isShowingTOC { + display: none; +} +nav { + display: none; +} \ No newline at end of file diff --git a/BaiduMTJ/ios_doc/hierarchy.html b/BaiduMTJ/ios_doc/hierarchy.html new file mode 100644 index 0000000..a27c67a --- /dev/null +++ b/BaiduMTJ/ios_doc/hierarchy.html @@ -0,0 +1,83 @@ + + + + + BaiduMobStat Hierarchy + + + + + +
+ + + + +
+ + + \ No newline at end of file diff --git a/BaiduMTJ/ios_doc/img/button_bar_background.png b/BaiduMTJ/ios_doc/img/button_bar_background.png new file mode 100644 index 0000000..71d1019 Binary files /dev/null and b/BaiduMTJ/ios_doc/img/button_bar_background.png differ diff --git a/BaiduMTJ/ios_doc/img/disclosure.png b/BaiduMTJ/ios_doc/img/disclosure.png new file mode 100644 index 0000000..4c5cbf4 Binary files /dev/null and b/BaiduMTJ/ios_doc/img/disclosure.png differ diff --git a/BaiduMTJ/ios_doc/img/disclosure_open.png b/BaiduMTJ/ios_doc/img/disclosure_open.png new file mode 100644 index 0000000..82396fe Binary files /dev/null and b/BaiduMTJ/ios_doc/img/disclosure_open.png differ diff --git a/BaiduMTJ/ios_doc/img/library_background.png b/BaiduMTJ/ios_doc/img/library_background.png new file mode 100644 index 0000000..3006248 Binary files /dev/null and b/BaiduMTJ/ios_doc/img/library_background.png differ diff --git a/BaiduMTJ/ios_doc/img/title_background.png b/BaiduMTJ/ios_doc/img/title_background.png new file mode 100644 index 0000000..846e496 Binary files /dev/null and b/BaiduMTJ/ios_doc/img/title_background.png differ diff --git a/BaiduMTJ/ios_doc/index.html b/BaiduMTJ/ios_doc/index.html new file mode 100644 index 0000000..d2876cc --- /dev/null +++ b/BaiduMTJ/ios_doc/index.html @@ -0,0 +1,79 @@ + + + + + BaiduMobStat Reference + + + + + +
+ + + + +
+ + + \ No newline at end of file diff --git a/BaiduMTJ/ios_manual.pdf b/BaiduMTJ/ios_manual.pdf new file mode 100644 index 0000000..1acffd3 Binary files /dev/null and b/BaiduMTJ/ios_manual.pdf differ diff --git a/GreedBaiduMTJSDK.podspec b/GreedBaiduMTJSDK.podspec new file mode 100644 index 0000000..c2e9bed --- /dev/null +++ b/GreedBaiduMTJSDK.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + + s.name = "GreedBaiduMTJSDK" + s.version = "3.7.2" + s.license = "MIT" + s.summary = "iOS鐗堢櫨搴︾粺璁DK" + s.homepage = "https://github.com/greedlab/GreedBaiduMTJSDK" + s.author = { "Bell" => "bell@greedlab.com" } + s.source = { :git => "https://github.com/greedlab/GreedBaiduMTJSDK.git", :tag => s.version } + s.platform = :ios + s.requires_arc = true + s.source_files = 'BaiduMTJ/ios_api/universal-bin/*.h' + s.vendored_libraries = 'BaiduMTJ/ios_api/universal-bin/libBaiduMobStat.a' + +end diff --git a/README.md b/README.md index ec8deb6..efe1d20 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # GreedBaiduMTJSDK + iOS鐗堢櫨搴︾粺璁DK + +* [鐧惧害缁熻](http://mtj.baidu.com/) +* [鐧惧害缁熻SDK涓嬭浇](http://mtj.baidu.com/web/sdk/index) + +## 瀹夎 + +``` +pod 'GreedBaiduMTJSDK' +``` +## LICENSE + +[MIT](LICENSE)