猎豆优选

TBSDKUTProtocol.h 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. // '########'########::'######:'########:'##:::'##:
  2. // ... ##..::##.... ##'##... ##:##.... ##:##::'##::
  3. // ::: ##::::##:::: ##:##:::..::##:::: ##:##:'##:::
  4. // ::: ##::::########:. ######::##:::: ##:#####::::
  5. // ::: ##::::##.... ##:..... ##:##:::: ##:##. ##:::
  6. // ::: ##::::##:::: ##'##::: ##:##:::: ##:##:. ##::
  7. // ::: ##::::########:. ######::########::##::. ##:
  8. // :::..::::........:::......::........::..::::..::
  9. //
  10. // Created by 亿刀 on 13-10-9.
  11. // Copyright (c) 2013年 Taobao.com. All rights reserved.
  12. //
  13. #import <Foundation/Foundation.h>
  14. @protocol TBSDKUTProtocol <NSObject>
  15. //=====================================基础统计=====================================
  16. /**
  17. * @brief 预初始化.
  18. *
  19. * @warning 必需:是
  20. *
  21. * 调用顺序:第一个被调用.
  22. *
  23. * 最佳位置:didFinishLaunchingWithOptions
  24. *
  25. * *Important:* 这个方法必须是最先被调用,该方法调用之后,所有的设置类方法方可调用.
  26. *
  27. *
  28. */
  29. +(void) preInit;
  30. /**
  31. * @brief 设置应用标识以及应用密钥.
  32. *
  33. * @param appKey 应用标识.
  34. *
  35. * @param appSecret 应用标识对应的密钥.
  36. *
  37. * @warning 必需:是
  38. *
  39. * 调用顺序:preInit->setKey.
  40. *
  41. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  42. *
  43. *
  44. *
  45. */
  46. +(void) setKey: (NSString *)appKey appSecret:(NSString *)appSecret;
  47. /**
  48. * @brief 设置渠道标识,能够在统计数据的时候区分来源渠道.
  49. *
  50. * @param channel 渠道标识.
  51. *
  52. * @warning 必需:可选,如果需要渠道统计
  53. *
  54. * 调用说明:如需要把统计的内容分渠道做细分,必须调用,如91渠道,360渠道.
  55. *
  56. * 调用顺序:preInit->setChannel.
  57. *
  58. * 最佳实践:[UT setChannel:@"700002"]
  59. *
  60. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  61. *
  62. *
  63. */
  64. +(void) setChannel : (NSString *) channel;
  65. /**
  66. * @brief 关闭埋点记录的友好翻译,展示原始数据格式.
  67. *
  68. * @warning 必需:可选,如需要对数据进行渠道细分
  69. *
  70. * 调用说明:调用本接口,TraceContent显示的数据既为线上存储的内容
  71. *
  72. * 调用顺序:preInit->turnOffLogFriendly.
  73. *
  74. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  75. *
  76. *
  77. */
  78. +(void) turnOffLogFriendly;
  79. /**
  80. * @brief 开启NavigationController的自动页面统计,包括页面进入,页面离开.
  81. *
  82. * @param excludePages 不希望被自动统计的controller列表.
  83. *
  84. * @warning 必需:可选,如果希望自动统计NavigationController
  85. *
  86. * 调用顺序:preInit->turnOnGlobalNavigationTrack.
  87. *
  88. * 最佳实践:[UT turnOnGlobalNavigationTrack:[[NSArray alloc]initWithObjects:@"NetworkController", nil]];非ARC请自己加autoRelease
  89. *
  90. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  91. *
  92. * *Important:* 这里的excludePages数组中名称必须为完整的controller名称,如:TestController.
  93. * 这里excludePages的场景,我们希望埋点的用户只用在这些页面有特定的埋点场景,如定制args参数。
  94. * 排除之后的页面,不受SDK调度,您可以在页面中埋一些个性化的需求
  95. *
  96. *
  97. */
  98. +(void) turnOnGlobalNavigationTrack:(NSArray *) excludePages;
  99. /**
  100. * @brief 关闭CrashHandler.
  101. * CrashHandler为应用出现异常时候的自动错误捕获组件.
  102. *
  103. * @warning 必需:可选,如果需要关闭CrashHandler
  104. *
  105. * 调用说明:默认开启.
  106. *
  107. * 调用顺序:preInit->turnOffCrashHandler.
  108. *
  109. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  110. *
  111. *
  112. */
  113. +(void) turnOffCrashHandler;
  114. /**
  115. * @brief 开启调试日志开关,可以详细的看到埋点内容以及其它日志.
  116. *
  117. * @warning 必需:可选,如果需要调试埋点
  118. *
  119. * 调用说明:显示埋点以及一些提示性的内容的全面日志.
  120. *
  121. * 调用顺序:preInit->turnDebug.
  122. *
  123. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  124. *
  125. *
  126. */
  127. +(void) turnOnDebug;
  128. /**
  129. * @brief 初始化,使得SDK真正开始工作.
  130. *
  131. * @warning 必需:是
  132. *
  133. * 调用说明:默认:异步调用.
  134. *
  135. * 调用顺序:preInit->init.
  136. *
  137. * 最佳位置:didFinishLaunchingWithOptions,preInit之后
  138. *
  139. *
  140. */
  141. +(void) init;
  142. /**
  143. * @brief 反初始化SDK,调用之后SDK无法继续进行埋点统计.
  144. *
  145. * @warning 必需:可选
  146. *
  147. * 调用说明:释放SDK.
  148. *
  149. * 调用顺序:preInit->init->uninit.
  150. *
  151. * 最佳位置:applicationWillTerminate
  152. *
  153. *
  154. */
  155. +(void) uninit;
  156. //=====================================初级入门:用户相关=====================================
  157. /**
  158. * @brief 统计用户登录/登出.
  159. *
  160. * @param usernick 用户昵称,如 AAAAAA
  161. *
  162. * @warning 必需:希望埋上
  163. *
  164. * 调用顺序:preInit->init->updateUserAccount.
  165. *
  166. * 最佳实践:用户登录:[UT updateUserAccount:@"*******A"].
  167. * 用户切换:[UT updateUserAccount:@"*******B"].
  168. * 用户注销:[UT updateUserAccount:@""].
  169. *
  170. * 最佳位置:成功或失败的登录API返回之后
  171. *
  172. * *Important:* 登录/切换/登出埋点必须是登录Api调用成功之后调用,反之会统计虚高
  173. *
  174. *
  175. */
  176. +(void) updateUserAccount:(NSString *) usernick;
  177. /**
  178. * @brief updateUserAccount接口的扩展版本,支持参数定制.
  179. *
  180. * @param usernick 用户昵称
  181. *
  182. * @param dict 需要传递到args中去的kv参数对
  183. *
  184. * 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  185. *
  186. * 调用顺序:preInit->init->updateUserAccount.
  187. *
  188. *
  189. */
  190. +(void) updateUserAccount:(NSString *) usernick
  191. args:(NSDictionary *) dict;
  192. /**
  193. * @brief 统计用户注册.
  194. *
  195. * @param usernick 用户昵称,如 "AAAAAA"
  196. *
  197. * @warning 最佳建议:有的话,希望埋上
  198. *
  199. * 调用顺序:preInit->init->userRegister.
  200. *
  201. * *Important:* 必须是注册Api调用成功之后调用,反之会统计虚高
  202. *
  203. *
  204. */
  205. +(void) userRegister:(NSString *) usernick;
  206. /**
  207. * @brief userRegister接口的扩展版本,支持参数定制.
  208. *
  209. * @param usernick 用户昵称
  210. *
  211. * @param dict 需要传递到args中去的kv参数对
  212. *
  213. * @warning 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  214. *
  215. * 调用顺序:preInit->init->userRegister.
  216. *
  217. * 最佳实践:[UT userRegister:@"******"]
  218. *
  219. * 最佳位置:注册API成功返回之后
  220. *
  221. *
  222. */
  223. +(void) userRegister:(NSString *) usernick args:(NSDictionary *) dict;
  224. //=====================================进阶:页面,控件以及相关=====================================
  225. /**
  226. * @brief 使用简单的页面名.
  227. *
  228. * @warning 调用说明:大家在定义页面名称的时候,很多都会采用如NetworkController等字样的名称,我们这个接口会统一把如NetworkController简化为Network.
  229. * 这个针对全局的NavigationController也有效
  230. *
  231. * 最佳建议:新使用用户,请务必用上,老用户,也希望慢慢的用上
  232. *
  233. * 调用顺序:preInit->useSimplePageName.
  234. *
  235. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  236. *
  237. * *Important:* 页面必须是"Controller"结尾的,要不不会有作用。
  238. *
  239. *
  240. */
  241. +(void) useSimplePageName;
  242. /**
  243. * @brief 绑定一个自定义的页面名到指定的页面对象上去.
  244. *
  245. * @param dict 页面需要绑定的名称列表
  246. *
  247. * @warning 调用说明:如一个页面叫TestController,我们需要埋点的时候,自动用Custom为页面名称,这样你只需把TestController为key,Custom为value即可,SDK会自动替换.
  248. *
  249. * 调用顺序:preInit->bindPageName.
  250. *
  251. * 最佳实践:[UT bindPageName:[NSDictionary dictionaryWithObjectsAndKeys:@"Coustom",@"NetworkController",nil]];
  252. *
  253. * 最佳位置:didFinishLaunchingWithOptions,preInit之后,init之前
  254. *
  255. *
  256. */
  257. +(void) bindPageName:(NSDictionary *) dict;
  258. /**
  259. * @brief 统计页面进入.
  260. *
  261. * @param pageName 页面名称
  262. *
  263. * @warning 调用说明:每个可以展现的页面都有进入和离开等生命周期,页面进入,意思就是进入了某个页面的时候。除了被自动覆盖的Controller之外的
  264. *
  265. * 调用顺序:preInit->init->pageEnter.
  266. *
  267. * 最佳实践:[UT pageEnter:@"Welcome"],不能出现非字母之外的字符,每个单词的首字母都大写,最好不要出现Page,Controller,View等关键词
  268. *
  269. * 最佳位置:页面的viewWillAppear中,自定义的页面框架除外
  270. *
  271. * *Important:* 必须是在页面的进入生命周期里
  272. *
  273. *
  274. */
  275. +(void) pageEnter:(NSObject *) pageName;
  276. /**
  277. * @brief 页面进入的扩展版本.
  278. *
  279. * @param pageName 页面名称
  280. *
  281. * @param dict 需要传递到args中去的kv参数对
  282. *
  283. * @warning *Important:* 页面必须埋上,除自动页面埋点之外
  284. *
  285. * 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  286. *
  287. * 调用顺序:preInit->init->pageEnter.
  288. *
  289. * 最佳实践:[UT pageEnter:@"Welcome" args:[NSDictionary dictionaryWithObjectsAndKeys:@"v1",@"k1",@"v2",@"k2",nil]],不能出现非字母之外的字符,每个单词的首字母都大写,最好不要出现Page,Controller,View等关键词
  290. *
  291. * 最佳位置:页面的viewWillAppear中,自定义的页面框架除外
  292. *
  293. *
  294. */
  295. +(void) pageEnter:(NSObject *) pageName args:(NSDictionary *) dict;
  296. /**
  297. * @brief 统计页面离开.
  298. *
  299. * @param pageName 页面名称
  300. *
  301. * @warning 调用说明:每个可以展现的页面都有进入和离开等生命周期,页面离开,意思就是离开了某个页面的时候。除了被自动覆盖的Controller之外的
  302. *
  303. * 调用顺序:preInit->init->pageLeave.
  304. *
  305. * 最佳实践:[UT pageLeave:@"Welcome"],不能出现非字母之外的字符,每个单词的首字母都大写,最好不要出现Page,Controller,View等关键词
  306. *
  307. * 最佳位置:页面的viewWillDisappear中,自定义的页面框架除外
  308. *
  309. * *Important:* 必须是在页面的进入生命周期里,如viewDidUnload,自定义的页面框架除外
  310. *
  311. *
  312. */
  313. +(void) pageLeave:(NSObject *) pageName;
  314. /**
  315. * @brief 页面离开的扩展版本.
  316. *
  317. * @param pageName 页面名称
  318. *
  319. * @param args 需要传递到args中去的kv参数对
  320. *
  321. * @param dict 需要传递到args中去的kv参数对
  322. *
  323. * @warning *Important:* 必须配对pageEnter出现
  324. *
  325. * 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  326. *
  327. * 调用顺序:preInit->init->pageLeave.
  328. *
  329. * 最佳实践:[UT pageLeave:@"Welcome" args:[NSDictionary dictionaryWithObjectsAndKeys:@"v1",@"k1",@"v2",@"k2",nil]],不能出现非字母之外的字符,每个单词的首字母都大写,最好不要出现Page,Controller,View等关键词
  330. *
  331. * 最佳位置:页面的viewWillDisappear中,自定义的页面框架除外
  332. *
  333. *
  334. */
  335. +(void) pageLeave:(NSObject *) pageName args:(NSDictionary *) dict;
  336. /**
  337. * @brief 统计控件点击.
  338. *
  339. * @param controlName 控件名称
  340. *
  341. * @warning *Important:* 埋点所在的页面必须埋点pageEnter,自动页面埋点除外
  342. *
  343. * 最佳建议:页面中的元素尽量全部打点,提高统计精度
  344. *
  345. * 调用顺序:preInit->init->ctrlClicked.
  346. *
  347. * 最佳实践:[UT ctrlClicked:@"Buy"];控件名称必须是全英文,每个单词的首字母大写,建议不包含button,list,listitem等控件相关的名称
  348. *
  349. * 最佳位置:页面中
  350. *
  351. *
  352. */
  353. +(void) ctrlClicked:(NSString *)controlName;
  354. /*! DEPRECATED */
  355. +(void) ctrlClicked:(NSString *)controlName onPage:(NSObject *) pageName;
  356. /**
  357. * @brief 控件点击的扩展版本.
  358. *
  359. * @param controlName 控件名称
  360. *
  361. * @param dict 需要传递到args中去的kv参数对
  362. *
  363. * @warning *Important:* 点所在的页面必须埋点pageEnter,自动页面埋点除外
  364. *
  365. * 最佳建议:页面中的元素尽量全部打点,提高统计精度
  366. *
  367. * 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  368. *
  369. * 调用顺序:preInit->init->ctrlClicked.
  370. *
  371. * 最佳实践:[UT ctrlClicked:@"Buy" args:[NSDictionary dictionaryWithObjectsAndKeys:@"yes",@"check",nil]];控件名称必须是全英文,每个单词的首字母大写,建议不包含button,list,listitem等控件相关的名称
  372. *
  373. * 最佳位置:页面中
  374. *
  375. *
  376. */
  377. +(void) ctrlClicked:(NSString *)controlName args:(NSDictionary *) dict;
  378. /*! DEPRECATED */
  379. +(void) ctrlClicked:(NSString *)controlName onPage:(NSObject *) pageName args:(NSDictionary *) dict;
  380. /**
  381. * @brief 统计列表项选中.
  382. *
  383. * @param controlName 控件名称
  384. *
  385. * @param andIndex 选中的列表项索引
  386. *
  387. * @warning *Important:* 埋点所在的页面必须埋点pageEnter,自动页面埋点除外
  388. *
  389. * 最佳建议:页面中的元素尽量全部打点,提高统计精度
  390. *
  391. * 调用顺序:preInit->init->itemSelected.
  392. *
  393. * 最佳实践:[UT itemSelected:@"Goods" andIndex:5];控件名称必须是全英文,每个单词的首字母大写,建议不包含button,list,listitem等控件相关的名称
  394. *
  395. * 最佳位置:页面中
  396. *
  397. *
  398. */
  399. +(void) itemSelected:(NSString *)controlName
  400. andIndex:(int) index;
  401. /*! DEPRECATED */
  402. +(void) itemSelected:(NSString *)controlName
  403. onPage:(NSObject *) pageName
  404. andIndex:(int) index;
  405. /**
  406. * @brief 控件列表项选中的扩展版本.
  407. *
  408. * @param controlName 控件名称
  409. *
  410. * @param andIndex 选中的列表项索引
  411. *
  412. * @param dict 需要传递到args中去的kv参数对
  413. *
  414. * @warning *Important:* 埋点所在的页面必须埋点pageEnter,自动页面埋点除外
  415. *
  416. * 最佳建议:页面中的元素尽量全部打点,提高统计精度
  417. *
  418. * 调用说明:dict中的参数反映在我们采集数据的args字段中,每个参数对用','分隔.
  419. *
  420. * 调用顺序:preInit->init->itemSelected.
  421. *
  422. * 最佳实践:[UT itemSelected:@"Goods" andIndex:5 args:[NSDictionary dictionaryWithObjectsAndKeys:@"yes",@"itemSelected",nil]];控件名称必须是全英文,每个单词的首字母大写,建议不包含button,list,listitem等控件相关的名称
  423. *
  424. * 最佳位置:页面中
  425. *
  426. *
  427. */
  428. +(void) itemSelected:(NSString *)controlName
  429. andIndex:(int) index
  430. args:(NSDictionary *) dict;
  431. /*! DEPRECATED */
  432. +(void) itemSelected:(NSString *)controlName
  433. onPage:(NSObject *) pageName
  434. andIndex:(int) index
  435. args:(NSDictionary *) dict;
  436. +(void) updatePageProperties:(NSObject *) pPageName properties:(NSDictionary *) pProperties;
  437. /**
  438. * @brief 强制上传,可以把当前打点的数据紧急上传.
  439. *
  440. * @warning *Important:* 紧急数据,需要提高上传率的,手工调用,这里提醒一下,会增加一次上传过程
  441. *
  442. * 调用说明:当我们迫切希望当前埋点的数据紧急被上传,那么我们就需要使用这个接口,让埋点立即被上传.
  443. *
  444. * 调用顺序:preInit->init->forceUpload.
  445. *
  446. * 最佳位置:紧急数据埋点之后
  447. *
  448. *
  449. */
  450. +(void) forceUpload;
  451. /**
  452. * @brief 统计GPS信息.
  453. *
  454. * @param pageName GPS采集的页面,和pageEnter里说明的规范一致
  455. *
  456. * @param longitude 经度
  457. *
  458. * @param latitude 纬度
  459. *
  460. * @warning *Important:* 有采集,就务必调用本接口
  461. *
  462. * 调用说明:在使用客户端的时候,很多应用会采集用户的经纬度信息.
  463. *
  464. * 调用顺序:preInit->init->updateGPSInfo.
  465. *
  466. * 最佳位置:获取经纬度之后
  467. *
  468. *
  469. */
  470. +(void) updateGPSInfo:(NSString *) pageName
  471. longitude:(double) longitude
  472. latitude:(double) latitude;
  473. /**
  474. * @brief 统计GPS信息的扩展版本.
  475. *
  476. * @param pageName GPS采集的页面,和pageEnter里说明的规范一致
  477. *
  478. * @param longitude 经度
  479. *
  480. * @param latitude 纬度
  481. *
  482. * @param dict 需要传递到args中去的kv参数对
  483. *
  484. * @warning *Important:* 有采集,就务必调用本接口
  485. *
  486. * 调用说明:在使用客户端的时候,很多应用会采集用户的经纬度信息.
  487. *
  488. * 调用顺序:preInit->init->updateGPSInfo.
  489. *
  490. * 最佳位置:获取经纬度之后
  491. *
  492. *
  493. */
  494. +(void) updateGPSInfo:(NSString *) pageName
  495. longitude:(double)longitude
  496. latitude:(double) latitude
  497. args:(NSDictionary *) dict;
  498. //=====================================进阶:Push效果统计=====================================
  499. /**
  500. * @brief 统计Push消息到达客户端.
  501. *
  502. * @param pushName Push名称
  503. *
  504. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  505. *
  506. * 调用说明:这个消息到达指客户端程序收到线上推送的消息.走ios的push通道,这个方法不需要使用.
  507. *
  508. * 调用顺序:preInit->init->pushArrive.
  509. *
  510. * 最佳位置:客户端程序收到Push通知
  511. *
  512. *
  513. */
  514. +(void) pushArrive:(NSString *) pushName;
  515. /**
  516. * @brief 统计Push消息到达客户端.
  517. *
  518. * @param pushName Push名称
  519. *
  520. * @param dict 需要传递到args中去的kv参数对
  521. *
  522. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  523. *
  524. * 调用说明:这个消息到达指客户端程序收到线上推送的消息.走ios的push通道,这个方法不需要使用.
  525. *
  526. * 调用顺序:preInit->init->pushArrive.
  527. *
  528. * 最佳位置:客户端程序收到Push通知
  529. *
  530. *
  531. */
  532. +(void) pushArrive:(NSString *) pushName args:(NSDictionary *) dict;
  533. /**
  534. * @brief 统计Push消息被展现.
  535. *
  536. * @param pushName Push名称
  537. *
  538. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  539. *
  540. * 调用说明:Push消息展现在某个地方,让用户看到.走ios的push通道,这个方法不需要使用.
  541. *
  542. * 调用顺序:preInit->init->pushDisplay.
  543. *
  544. * 最佳位置:客户端要做展现操作的时候
  545. *
  546. *
  547. */
  548. +(void) pushDisplay:(NSString *) pushName;
  549. /**
  550. * @brief 统计Push消息被展现.
  551. *
  552. * @param pushName Push名称
  553. *
  554. * @param dict 需要传递到args中去的kv参数对
  555. *
  556. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  557. *
  558. * 调用说明:Push消息展现在某个地方,让用户看到.走ios的push通道,这个方法不需要使用.
  559. *
  560. * 调用顺序:preInit->init->pushDisplay.
  561. *
  562. * 最佳位置:客户端要做展现操作的时候
  563. *
  564. *
  565. */
  566. +(void) pushDisplay:(NSString *) pushName args:(NSDictionary *) dict;
  567. /**
  568. * @brief 统计Push消息点击.
  569. *
  570. * @param pushName Push名称
  571. *
  572. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  573. *
  574. * 调用说明:Push消息在展现被用户看到之后,接着被点击了.
  575. *
  576. * 调用顺序:preInit->init->pushView.
  577. *
  578. * 最佳位置:Push内容被点击之后
  579. *
  580. *
  581. */
  582. +(void) pushView:(NSString *) pushName;
  583. /**
  584. * @brief 统计Push消息点击.
  585. *
  586. * @param pushName Push名称
  587. *
  588. * @param dict 需要传递到args中去的kv参数对
  589. *
  590. * @warning *Important:* 客户端内有自己的Push体系,务必埋点
  591. *
  592. * 调用说明:Push消息在展现被用户看到之后,接着被点击了.
  593. *
  594. * 调用顺序:preInit->init->pushView.
  595. *
  596. * 最佳位置:Push内容被点击之后
  597. *
  598. *
  599. */
  600. +(void) pushView:(NSString *) pushName args:(NSDictionary *) dict;
  601. /**
  602. * @brief 统计关键词搜索.
  603. *
  604. * @param keywork 关键词
  605. *
  606. * @param underCategory 关键词所属的分类
  607. *
  608. * @warning 调用说明:如进入了搜索页面,点击搜索按钮搜索了某个关键词.
  609. *
  610. * 调用顺序:preInit->init->searchKeyword.
  611. *
  612. * 最佳位置:搜索关键词之后
  613. *
  614. *
  615. */
  616. +(void) searchKeyword:(NSString *) keyword underCategory:(NSString *) category;
  617. /**
  618. * @brief 统计关键词搜索扩张版本.
  619. *
  620. * @param keywork 关键词
  621. *
  622. * @param underCategory 关键词所属的分类
  623. *
  624. * @param dict 需要传递到args中去的kv参数对
  625. *
  626. * @warning 调用说明:如进入了搜索页面,点击搜索按钮搜索了某个关键词.
  627. *
  628. * 调用顺序:preInit->init->searchKeyword.
  629. *
  630. * 最佳位置:搜索关键词之后
  631. *
  632. *
  633. */
  634. +(void) searchKeyword:(NSString *) keyword underCategory:(NSString *) category args:(NSDictionary *) dict;
  635. /**
  636. * @brief 统计内容分享.
  637. *
  638. * @param content 分享内容
  639. *
  640. * @param underCategory 内容所属的分类
  641. *
  642. * @warning 调用说明:如新浪微博分享.
  643. *
  644. * 调用顺序:preInit->init->share.
  645. *
  646. * 最佳位置:分享之后
  647. *
  648. *
  649. */
  650. +(void) share:(NSString *) content underCategory:(NSString *) category;
  651. /**
  652. * @brief 统计内容分享.
  653. *
  654. * @param content 分享内容
  655. *
  656. * @param underCategory 内容所属的分类
  657. *
  658. * @param dict 需要传递到args中去的kv参数对
  659. *
  660. * @warning 调用说明:如新浪微博分享.
  661. *
  662. * 调用顺序:preInit->init->share.
  663. *
  664. * 最佳位置:分享之后
  665. *
  666. *
  667. */
  668. +(void) share:(NSString *) content underCategory:(NSString *) category args:(NSDictionary *) dict;
  669. //=====================================高级:Native与WebView相结合=====================================
  670. /**
  671. * @brief 更新UTSID到Cookie,调用接口之后,能够把url对应的页面数据和本地数据关联起来.
  672. *
  673. * @param url 需要种植utsid的url地址.
  674. *
  675. * @warning 调用说明:我们在进行Native与Webview数据进行交叉统计的时候,需要有一个关联的主键,就是utsid.
  676. *
  677. * 调用顺序:preInit->init->updateUTSIDToCookie.
  678. *
  679. * 最佳位置:打开Webview的时候,在request之前
  680. *
  681. *
  682. */
  683. +(void) updateUTSIDToCookie:(NSString *) url;
  684. /**
  685. * @brief 更新业务内容到Cookie,调用之后,能够把业务参数携带到url对应的页面的cookie中去.
  686. *
  687. * @param url 需要种植utkey的Url
  688. *
  689. * @param dict 需要传递到args中去的kv参数对
  690. *
  691. * @warning 调用说明:更新业务到Cookie中去,字段为utkey,内容为urlEncode(业务Key)=urlEncode(业务内容),urlEncode(业务Key2)=urlEncode(业务内容2)....
  692. *
  693. * 调用顺序:preInit->init->updateUTCookie.
  694. *
  695. * 最佳实践:[UT updateUTCookie:@"http://www.google.com" dict:[NSDictionary dictionaryWithObjectsAndKeys:@"Value1",@"key1",@"value2",@"key2",nil]];
  696. *
  697. * 最佳位置:打开Webview的时候,在request之前
  698. *
  699. */
  700. +(void) updateUTCookie:(NSString *) url dict:(NSDictionary *) dict;
  701. //=====================================高级:交易相关=====================================
  702. /**
  703. * @brief 统计交易.
  704. *
  705. * @param orderID 订单ID
  706. *
  707. * @warning 调用说明:在交易下单的时候,我们需要把生成的订单号,我们需要通过这个接口去记录.
  708. *
  709. * 调用顺序:preInit->init->trade.
  710. *
  711. * 最佳位置:交易下单生成订单ID之后
  712. *
  713. *
  714. */
  715. +(void) trade:(NSString *) orderID;
  716. /**
  717. * @brief 统计交易.
  718. *
  719. * @param orderID 订单ID
  720. *
  721. * @param dict 需要传递到args中去的kv参数对
  722. *
  723. * @warning 调用说明:在交易下单的时候,我们需要把生成的订单号,我们需要通过这个接口去记录.
  724. *
  725. * 调用顺序:preInit->init->trade.
  726. *
  727. * 最佳位置:交易下单生成订单ID之后
  728. *
  729. *
  730. */
  731. +(void) trade:(NSString *) orderID args:(NSDictionary *) dict;
  732. //=====================================高级:自定义埋点=====================================
  733. /**
  734. * @brief 普通自定义埋点.
  735. *
  736. * @param eventId 事件ID,使用前,需要在我们的网站去登记
  737. *
  738. * @param dict 事件携带的属性
  739. *
  740. * @warning 调用顺序:preInit->init->commitEvent.
  741. *
  742. *
  743. */
  744. + (void)commitEvent:(NSString *) eventId dict:(NSDictionary *) pDict;
  745. /**
  746. * @brief 时长自定义埋点[开始].
  747. *
  748. * @param eventId 事件ID,使用前,需要在我们的网站去登记,开始和结束必须使用相同的EventID
  749. *
  750. * @param dict 事件携带的属性
  751. *
  752. * @warning 时长统计的EventID必须有且仅有一个路径,也就是全局只能用一次,并且不能把时长和普通的混用
  753. *
  754. * 调用顺序:preInit->init->commitEvent.
  755. *
  756. *
  757. */
  758. + (void)commitEventBegin:(NSString *) eventId dict:(NSDictionary *) pDict;
  759. /**
  760. * @brief 时长自定义埋点[结束].
  761. *
  762. * @param eventId 事件ID,使用前,需要在我们的网站去登记,开始和结束必须使用相同的EventID。
  763. *
  764. * @param dict 事件携带的属性
  765. *
  766. * @warning 时长统计的Event必须有且仅有一个路径,也就是全局只能用一次,并且不能把时长和普通的混用
  767. *
  768. * 调用顺序:preInit->init->commitEvent.
  769. *
  770. *
  771. */
  772. + (void)commitEventEnd:(NSString *) eventId dict:(NSDictionary *) pDict;
  773. /**
  774. * @brief 自定义埋点(DEPRECATED).
  775. *
  776. * @param eventId 行为ID,若需要使用,需要和我们沟通
  777. *
  778. * @warning 调用说明:我们可以自主的控制埋点的格式以及内容,eventId这个参数对应行为记录的eventid.
  779. *
  780. * 调用顺序:preInit->init->commitEvent.
  781. *
  782. *
  783. */
  784. + (void)commitEvent:(int)eventId;/*! DEPRECATED */
  785. /**
  786. * @brief 自定义埋点(DEPRECATED).
  787. *
  788. * @param eventId 行为ID,若需要使用,需要和我们沟通
  789. *
  790. * @param arg1 参数1
  791. *
  792. * @warning 调用说明:我们可以自主的控制埋点的格式以及内容,eventId这个参数对应行为记录的eventid,arg1对应行为记录的arg1.
  793. *
  794. * 调用顺序:preInit->init->commitEvent.
  795. *
  796. *
  797. */
  798. + (void)commitEvent:(int)eventId
  799. arg1:(NSString *)arg1;/*! DEPRECATED */
  800. /**
  801. * @brief 自定义埋点(DEPRECATED).
  802. *
  803. * @param eventId 行为ID,若需要使用,需要和我们沟通
  804. *
  805. * @param arg1 参数1
  806. *
  807. * @param arg2 参数2
  808. *
  809. * @warning 调用说明:我们可以自主的控制埋点的格式以及内容,eventId这个参数对应行为记录的eventid,arg1对应行为记录的arg1,依次类推.
  810. *
  811. * 调用顺序:preInit->init->commitEvent.
  812. *
  813. *
  814. */
  815. + (void)commitEvent:(int)eventId
  816. arg1:(NSString *)arg1
  817. arg2:(NSString *)arg2;/*! DEPRECATED */
  818. /**
  819. * @brief 自定义埋点(DEPRECATED).
  820. *
  821. * @param eventId 行为ID,若需要使用,需要和我们沟通
  822. *
  823. * @param arg1 参数1
  824. *
  825. * @param arg2 参数2
  826. *
  827. * @param arg3 参数3
  828. *
  829. * @warning 调用说明:我们可以自主的控制埋点的格式以及内容,eventId这个参数对应行为记录的eventid,arg1对应行为记录的arg1,依次类推.
  830. *
  831. * 调用顺序:preInit->init->commitEvent.
  832. *
  833. *
  834. */
  835. + (void)commitEvent:(int)eventId
  836. arg1:(NSString *)arg1
  837. arg2:(NSString *)arg2
  838. arg3:(NSString *)arg3;/*! DEPRECATED */
  839. /**
  840. * @brief 自定义埋点(DEPRECATED).
  841. *
  842. * @param eventId 行为ID,若需要使用,需要和我们沟通
  843. *
  844. * @param arg1 参数1
  845. *
  846. * @param arg2 参数2
  847. *
  848. * @param arg3 参数3
  849. *
  850. * @param args 参数s
  851. *
  852. * @param dict 需要传递到args中去的kv参数对
  853. *
  854. * @warning 调用说明:我们可以自主的控制埋点的格式以及内容,eventId这个参数对应行为记录的eventid,arg1对应行为记录的arg1,依次类推.
  855. *
  856. * 调用顺序:preInit->init->commitEvent.
  857. *
  858. *
  859. */
  860. + (void)commitEvent:(int)eventId
  861. arg1:(NSString *)arg1
  862. arg2:(NSString *)arg2
  863. arg3:(NSString *)arg3 args:(NSDictionary *) dict;/*! DEPRECATED */
  864. + (void)commitEvent:(NSObject *)page
  865. eventID:(int)eventID
  866. arg1:(NSString *)arg1
  867. arg2:(NSString *)arg2
  868. arg3:(NSString *)arg3
  869. args:(NSDictionary *) dict;/*! DEPRECATED */
  870. //=====================================其它=====================================
  871. /**
  872. * @brief 获取SDK生成的设备唯一标识.
  873. *
  874. * @warning 调用说明:这个设备唯一标识是持久的,并且格式安全,iOS6以及以下,多应用互通.
  875. *
  876. * 调用顺序:utdid任意时刻都可以调用.
  877. *
  878. * @return 24字节的设备唯一标识.
  879. */
  880. +(NSString *) utdid;
  881. /**
  882. * @brief 获取SDK生成的会话ID.
  883. *
  884. * @warning 调用说明:SDK初始化完成之后,会分配一个唯一的会话ID.
  885. *
  886. * 调用顺序:SDK 异步init完成之后.
  887. *
  888. *
  889. * @return 格式:"utdid_appkey_timestamp".
  890. */
  891. +(NSString *) utsid;
  892. // 开启安全黑匣子支持
  893. +(void) turnOnSecuritySDKSupport;
  894. @end