TalkingDataAppCpa.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. //
  2. // TalkingDataAppCpa.h
  3. // TalkingDataAppCpa
  4. //
  5. // Created by liweiqiang on 13-12-25.
  6. // Copyright (c) 2012年 __TendCloud__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface TDOrder : NSObject
  10. /**
  11. * @method orderWithOrderId
  12. * @param orderId 订单id 类型:NSString
  13. * @param total 订单总价 类型:int
  14. * @param currencyType 币种 类型:NSString
  15. */
  16. + (TDOrder *)orderWithOrderId:(NSString *)orderId total:(int)total currencyType:(NSString *)currencyType;
  17. /**
  18. * @method addItemWithCategory
  19. * @param category 商品类别 类型:NSString
  20. * @param name 商品名称 类型:NSString
  21. * @param unitPrice 商品单价 类型:int
  22. * @param amount 商品数量 类型:int
  23. */
  24. - (TDOrder *)addItemWithCategory:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  25. /**
  26. * @method addItemWithCategory
  27. * @param category 商品类别 类型:NSString
  28. * @param itemId 商品Id 类型:NSString
  29. * @param name 商品名称 类型:NSString
  30. * @param unitPrice 商品单价 类型:int
  31. * @param amount 商品数量 类型:int
  32. */
  33. - (TDOrder *)addItemWithCategory:(NSString *)category itemId:(NSString *)itemId name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  34. @end
  35. @interface TDShoppingCart : NSObject
  36. /**
  37. * @method createShoppingCart
  38. */
  39. + (TDShoppingCart *)createShoppingCart;
  40. /**
  41. * @method addItemWithCategory
  42. * @param category 商品类别 类型:NSString
  43. * @param itemId 商品Id 类型:NSString
  44. * @param name 商品名称 类型:NSString
  45. * @param unitPrice 商品单价 类型:int
  46. * @param amount 商品数量 类型:int
  47. */
  48. - (TDShoppingCart *)addItemWithCategory:(NSString *)category itemId:(NSString *)itemId name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  49. @end
  50. @interface TalkingDataAppCpa : NSObject
  51. /**
  52. * @method setVerboseLogDisabled 设置不显示日志 如发布时不需显示日志,应当最先调用该方法
  53. */
  54. + (void)setVerboseLogDisabled;
  55. /**
  56. * @method backgroundSessionEnabled
  57. * 开启后台使用时长统计,需在SDK初始化之前调用。
  58. */
  59. + (void)backgroundSessionEnabled;
  60. /**
  61. * @method enableSFSafariViewControllerTracking 用于精准的追踪以Safari作为资源载体的广告来源 如果需要使用应当在init方法之前调用
  62. */
  63. + (void)enableSFSafariViewControllerTracking NS_DEPRECATED_IOS(10_0, NA, "此方法会影响到用户交互,使用前请确保和产品、业务沟通清楚!");
  64. /**
  65. * @method init 初始化统计实例 请在application:didFinishLaunchingWithOptions:方法里调用
  66. * @param appID 应用标识 类型:NSString 应用的唯一标识,统计后台注册得到
  67. * @param channelId 渠道名(可选) 类型:NSString 如“app store”
  68. */
  69. + (void)init:(NSString *)appID withChannelId:(NSString *)channelId;
  70. /**
  71. * @method onReceiveDeepLink
  72. * @param link 链接 类型:NSURL
  73. */
  74. + (void)onReceiveDeepLink:(NSURL *)link;
  75. /**
  76. * @method onRegister 登录
  77. * @param account 账户名称 类型:NSString
  78. */
  79. + (void)onRegister:(NSString *)account;
  80. /**
  81. * @method onLogin 登录
  82. * @param account 账户名称 类型:NSString
  83. */
  84. + (void)onLogin:(NSString *)account;
  85. /**
  86. * @method onCreateRole 创建角色
  87. * @param name 角色名称 类型:NSString
  88. */
  89. + (void)onCreateRole:(NSString *)name;
  90. /**
  91. * @method onPay 支付
  92. * @param account 账户名称 类型:NSString
  93. * @param orderId 订单id 类型:NSString
  94. * @param amount 金额 类型:int
  95. * @param currencyType 币种 类型:NSString
  96. * @param payType 支付类型 类型:NSString
  97. */
  98. + (void)onPay:(NSString *)account withOrderId:(NSString *)orderId withAmount:(int)amount withCurrencyType:(NSString *)currencyType withPayType:(NSString *)payType;
  99. /**
  100. * @method onPay 支付
  101. * @param account 账户名称 类型:NSString
  102. * @param orderId 订单id 类型:NSString
  103. * @param amount 金额 类型:int
  104. * @param currencyType 币种 类型:NSString
  105. * @param payType 支付类型 类型:NSString
  106. * @param order 订单详情 类型:TDOrder
  107. */
  108. + (void)onPay:(NSString *)account withOrderId:(NSString *)orderId withAmount:(int)amount withCurrencyType:(NSString *)currencyType withPayType:(NSString *)payType withOrder:(TDOrder *)order;
  109. /**
  110. * @method onPay 支付
  111. * @param account 账户名称 类型:NSString
  112. * @param orderId 订单id 类型:NSString
  113. * @param amount 金额 类型:int
  114. * @param currencyType 币种 类型:NSString
  115. * @param payType 支付类型 类型:NSString
  116. * @param itemId 商品id 类型:NSString
  117. * @param itemCount 商品个数 类型:int
  118. */
  119. + (void)onPay:(NSString *)account withOrderId:(NSString *)orderId withAmount:(int)amount withCurrencyType:(NSString *)currencyType withPayType:(NSString *)payType withItemId:(NSString *)itemId withItemCount:(int)itemCount;
  120. /**
  121. * @method onPlaceOrder 下单
  122. * @param account 账户名称 类型:NSString
  123. * @param order 订单 类型:TDOrder
  124. */
  125. + (void)onPlaceOrder:(NSString *)account withOrder:(TDOrder *)order;
  126. /**
  127. * @method onOrderPaySucc 支付
  128. * @param account 账户名称 类型:NSString
  129. * @param orderId 订单id 类型:NSString
  130. * @param amount 金额 类型:int
  131. * @param currencyType 币种 类型:NSString
  132. * @param payType 支付类型 类型:NSString
  133. */
  134. + (void)onOrderPaySucc:(NSString *)account withOrderId:(NSString *)orderId withAmount:(int)amount withCurrencyType:(NSString *)currencyType withPayType:(NSString *)payType;
  135. /**
  136. * @method onViewItemWithCategory
  137. * @param category 商品类别 类型:NSString
  138. * @param itemId 商品Id 类型:NSString
  139. * @param name 商品名称 类型:NSString
  140. * @param unitPrice 商品单价 类型:int
  141. */
  142. + (void)onViewItemWithCategory:(NSString *)category itemId:(NSString *)itemId name:(NSString *)name unitPrice:(int)unitPrice;
  143. /**
  144. * @method onAddItemToShoppingCartWithCategory
  145. * @param category 商品类别 类型:NSString
  146. * @param itemId 商品Id 类型:NSString
  147. * @param name 商品名称 类型:NSString
  148. * @param unitPrice 商品单价 类型:int
  149. * @param amount 商品数量 类型:int
  150. */
  151. + (void)onAddItemToShoppingCartWithCategory:(NSString *)category itemId:(NSString *)itemId name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  152. /**
  153. * @method onViewShoppingCart
  154. * @param shoppingCart 购物车信息 类型:TDShoppingCart
  155. */
  156. + (void)onViewShoppingCart:(TDShoppingCart *)shoppingCart;
  157. /**
  158. * @method getDeviceId 获取设备Id
  159. */
  160. + (NSString *)getDeviceId;
  161. @end