酷店

AlibcUT.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /*
  2. * AlibcUT.h
  3. *
  4. * 阿里百川电商
  5. * 项目名称:阿里巴巴电商 AlibcTradeCommon
  6. * 版本号:3.1.1.93
  7. * 发布时间:2017-03-06
  8. * 开发团队:阿里巴巴百川商业化团队
  9. * 阿里巴巴电商SDK答疑群号:1229144682(阿里旺旺)
  10. * Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #ifndef AlibcUT_h
  14. #define AlibcUT_h
  15. #define ALiTRADE_TRACE_TRACKER_ID @"aliTradesdk"
  16. typedef NSString AlibcUTEventID;
  17. @class UIWebView;
  18. @class UIViewController;
  19. FOUNDATION_EXTERN NSString *AlibcUTGlobalPropertySdkVersion;
  20. FOUNDATION_EXTERN NSString *AlibcUTGlobalPropertyTTID;
  21. /*
  22. * @brief 用于透出事件埋点
  23. */
  24. FOUNDATION_EXTERN AlibcUTEventID *const AlibcUTEventID$2201;
  25. /*
  26. * @brief 用于点击事件埋点
  27. */
  28. FOUNDATION_EXTERN AlibcUTEventID *const AlibcUTEventID$2101;
  29. FOUNDATION_EXTERN NSString *const AlibcUTArgsKeyYBHPSS;
  30. FOUNDATION_EXTERN NSString *const AlibcUTArgsKeyYBHPSS_LABEL;
  31. @interface AlibcUT : NSObject
  32. /**
  33. 初始化 ALiUT
  34. */
  35. + (void)initUT;
  36. /**
  37. 功能是否可用, 是否有 adapter 支撑功能
  38. @return 是否可用
  39. */
  40. + (BOOL)isAvailable;
  41. /**
  42. 是否三方ut
  43. @return 是否三方ut
  44. */
  45. + (BOOL)isThird;
  46. /**
  47. 添加打点记录的便捷方法
  48. @param page pageName
  49. @param label arg1
  50. @param interval 无效兼容字段
  51. @param propertyDict args
  52. */
  53. + (void)addTraceLog:(NSString *)page
  54. label:(NSString *)label
  55. interval:(NSInteger)interval
  56. propertys:(NSDictionary *)propertyDict;
  57. /**
  58. 添加打点记录的便捷方法
  59. @param label arg1
  60. @param propertyDict args
  61. */
  62. + (void)addTraceLog:(NSString *)label propertys:(NSDictionary *)propertyDict;
  63. /**
  64. 添加打点记录的便捷方法
  65. @param label arg1
  66. */
  67. + (void)addTraceLog:(NSString *)label;
  68. /**
  69. 添加打点记录的便捷方法
  70. @param eventID eventID
  71. @param arg1 arg1
  72. @param args args
  73. */
  74. + (void)addTradeLogWithEventID:(AlibcUTEventID *)eventID arg1:(NSString *)arg1 args:(NSDictionary *)args;
  75. /**
  76. 添加打点记录的便捷方法
  77. @param trackerID trackerID
  78. @param eventLabel arg1
  79. @param properties args
  80. */
  81. + (void)addTrackToTracker:(NSString *)trackerID eventLabel:(NSString *)eventLabel properties:(NSDictionary *)properties;
  82. /**
  83. 打点的标准实现
  84. @param trackerID track id
  85. @param eventID 事件 id
  86. @param pageName pageName
  87. @param arg1 arg1 == label
  88. @param arg2 arg2 description
  89. @param arg3 arg3 description
  90. @param args args == propertirs
  91. */
  92. + (void)addTradeLog:(NSString *)trackerID
  93. eventID:(NSString *)eventID
  94. page:(NSString *)pageName
  95. arg1:(NSString *)arg1
  96. arg2:(NSString *)arg2
  97. arg3:(NSString *)arg3
  98. args:(NSDictionary *)args;
  99. /**
  100. 供jsbridge打点
  101. @param dataDict dataDict
  102. @param pView webView
  103. @param pViewController vc
  104. @return return value
  105. */
  106. + (BOOL)h5UT:(NSDictionary *)dataDict view:(UIWebView *)pView viewController:(UIViewController *)pViewController;
  107. /**
  108. 设置 channel
  109. @param channel channel
  110. */
  111. + (void)setChannel:(NSString *)channel;
  112. /**
  113. 读取全局字段
  114. @param key 字段名
  115. @return 值
  116. */
  117. + (NSString *)globalPropertyForKey:(NSString *)key;
  118. /**
  119. 设置全局字段
  120. @param property 值
  121. @param key 字段名
  122. */
  123. + (void)setGlobalProperty:(NSString *)property forKey:(NSString *)key;
  124. @end
  125. @protocol AlibcUTAdapter <NSObject>
  126. #pragma mark - Initialize
  127. @required
  128. - (void)initWithAppkey:(NSString *)appkey;
  129. #pragma mark - Configure
  130. @required
  131. - (void)setChannel:(NSString *)channel;
  132. @required
  133. - (NSString *)globalPropertyForKey:(NSString *)key asTracker:(NSString *)trackerID;
  134. @required
  135. - (void)setGlobalProperty:(NSString *)property forKey:(NSString *)key asTracker:(NSString *)trackerID;
  136. #pragma mark - Commit
  137. @required
  138. - (void)addTradeLog:(NSString *)trackerID
  139. eventID:(NSString *)eventID
  140. page:(NSString *)pageName
  141. arg1:(NSString *)arg1
  142. arg2:(NSString *)arg2
  143. arg3:(NSString *)arg3
  144. args:(NSDictionary *)args;
  145. @optional
  146. - (void)h5UT:(NSDictionary *)dataDict view:(UIWebView *)pView viewController:(UIViewController *)pViewController;
  147. #pragma mark - Other
  148. @optional
  149. - (BOOL)isThird;
  150. @end
  151. #define AlibcNSStringify(a) @#a
  152. #define AlibcAppendUTSuffixUtil AlibcNSStringify(_aliTradesdk_)AlibcTradeBizSDKVersion
  153. #endif