XGPush.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  1. //
  2. // TPNS核心接口
  3. // TPNS-SDK
  4. //
  5. // Created by xiangchen on 13-10-18.
  6. // Update by uweiyuan on 4/08/17.
  7. // Copyright (c) 2019 TEG of Tencent. All rights reserved.
  8. //
  9. #import <Foundation/Foundation.h>
  10. #import <UIKit/UIKit.h>
  11. #if __IPHONE_OS_VERSION_MIN_REQUIRED
  12. #import <UserNotifications/UserNotifications.h>
  13. #endif
  14. #pragma mark - XGPush代理,提供注册及反注册结果回调,消息接收及消息点击回调,设置角标回调
  15. /**
  16. @brief 监控TPNS服务启动和设备token注册的一组方法
  17. */
  18. @protocol XGPushDelegate <NSObject>
  19. @optional
  20. #pragma mark - ********注册相关回调********
  21. /**
  22. @brief 注册推送服务回调(TPNS SDK1.2.6.0+)
  23. @param deviceToken APNs 生成的Device Token
  24. @param xgToken TPNS 生成的 Token,推送消息时需要使用此值。TPNS 维护此值与APNs 的 Device Token的映射关系
  25. @param error 错误信息,若error为nil则注册推送服务成功
  26. */
  27. - (void)xgPushDidRegisteredDeviceToken:(nullable NSString *)deviceToken xgToken:(nullable NSString *)xgToken error:(nullable NSError *)error;
  28. /**
  29. @brief 注册推送服务失败回调(TPNS SDK1.2.7.1+)
  30. @param error 注册失败错误信息
  31. */
  32. - (void)xgPushDidFailToRegisterDeviceTokenWithError:(nullable NSError *)error;
  33. /**
  34. @brief 反注册回调,当您调用了终止TPNS服务接口stopXGNotification时会收到此回调
  35. @param isSuccess TPNS是否终止
  36. @param error TPNS推动终止错误的信息
  37. */
  38. - (void)xgPushDidFinishStop:(BOOL)isSuccess error:(nullable NSError *)error;
  39. #pragma mark - ********通知相关回调********
  40. /**
  41. @brief 统一消息出口,此接口对不同操作系统版本的消息接口进行了封装
  42. @param notification 通知内容,需要根据返回类型来确定
  43. @param completionHandler 接收到消息的回调,必须要调用
  44. @note 自建通道消息也会通过此回调转发给应用侧使用,自建通道消息体结构与APNs通知消息体结构相同
  45. */
  46. - (void)xgPushDidReceiveRemoteNotification:(nonnull id)notification withCompletionHandler:(nullable void (^)(NSUInteger))completionHandler;
  47. /// 统一点击回调(TPNS SDK1.2.7.1+)
  48. /// @param response 如果iOS 10+/macOS 10.14+则为UNNotificationResponse,低于目标版本则为NSDictionary
  49. - (void)xgPushDidReceiveNotificationResponse:(nonnull id)response withCompletionHandler:(nonnull void (^)(void))completionHandler;
  50. #pragma mark - ********其他相关回调********
  51. /**
  52. @brief 监控设置TPNS服务器下发角标的情况
  53. @param isSuccess isSuccess 上报是否成功
  54. @param error 设置失败的信息
  55. */
  56. - (void)xgPushDidSetBadge:(BOOL)isSuccess error:(nullable NSError *)error;
  57. /**
  58. @brief 通知权限弹窗的回调
  59. @param isEnable 用户是否允许
  60. @param error 错误信息
  61. */
  62. - (void)xgPushDidRequestNotificationPermission:(bool)isEnable error:(nullable NSError *)error;
  63. /**
  64. @brief TPNS日志回调方法
  65. @param logInfo 日志信息
  66. @note 可以在此方法获取TPNS的log日志。此方法和XGPush->enableDebug无关。
  67. */
  68. - (void)xgPushLog:(nullable NSString *)logInfo;
  69. /**
  70. @brief TPNS采集字段回调方法,如果需要知道TPNS采集的字段可实现此方法
  71. @param field 字段信息
  72. @param description 字段描述
  73. */
  74. - (void)xgPushDidCollectField:(nonnull NSString *)field andDescription:(nonnull NSString *)description;
  75. /// TPNS网络连接成功
  76. - (void)xgPushNetworkConnected;
  77. /// TPNS网络连接断开
  78. - (void)xgPushNetworkDisconnected;
  79. #pragma mark - ********XGPushDelegate,建议废弃的代理回调********
  80. /**
  81. @brief 监控TPNS服务地启动情况(已废弃)
  82. @param isSuccess TPNS是否启动成功
  83. @param error TPNS启动错误的信息
  84. */
  85. - (void)xgPushDidFinishStart:(BOOL)isSuccess
  86. error:(nullable NSError *)error
  87. __deprecated_msg("This method is no longer called, using xgPushDidRegisteredDeviceToken:xgToken:error: instead");
  88. /**
  89. @brief 设备token注册TPNS服务的回调
  90. @param deviceToken APNs 生成的Device Token
  91. @param error 错误信息
  92. */
  93. - (void)xgPushDidRegisteredDeviceToken:(nullable NSString *)deviceToken
  94. error:(nullable NSError *)error
  95. __deprecated_msg("recommended to use xgPushDidRegisteredDeviceToken:xgToken:error: instead");
  96. /**
  97. @brief 监控TPNS服务上报推送消息的情况
  98. @param isSuccess 上报是否成功
  99. @param error 上报失败的信息
  100. */
  101. - (void)xgPushDidReportNotification:(BOOL)isSuccess
  102. error:(nullable NSError *)error __deprecated_msg("You should no longer call it, SDK handles it automatically.");
  103. /**
  104. @brief 处理iOS 10、macOS10.14 UNUserNotification.framework的对应的方法
  105. @param center [UNUserNotificationCenter currentNotificationCenter]
  106. @param notification 通知对象
  107. @param completionHandler 回调对象,必须调用
  108. */
  109. - (void)xgPushUserNotificationCenter:(nonnull UNUserNotificationCenter *)center
  110. willPresentNotification:(nullable UNNotification *)notification
  111. withCompletionHandler:(nonnull void (^)(UNNotificationPresentationOptions options))completionHandler __IOS_AVAILABLE(10.0)
  112. __OSX_AVAILABLE(10.14)
  113. __deprecated_msg("recommended to use xgPushDidReceiveRemoteNotification:withCompletionHandler: instead");
  114. /**
  115. @brief 处理iOS 10、macOS10.14 UNUserNotification.framework的对应的方法
  116. @param center [UNUserNotificationCenter currentNotificationCenter]
  117. @param response 用户对通知消息的响应对象
  118. @param completionHandler 回调对象,必须调用
  119. */
  120. - (void)xgPushUserNotificationCenter:(nonnull UNUserNotificationCenter *)center
  121. didReceiveNotificationResponse:(nullable UNNotificationResponse *)response
  122. withCompletionHandler:(nonnull void (^)(void))completionHandler __IOS_AVAILABLE(10.0)__OSX_AVAILABLE(10.14)
  123. __deprecated_msg("recommended to use xgPushDidReceiveNotificationResponse:withCompletionHandler: instead");
  124. @end
  125. #pragma mark - XGPush类,提供注册及反注册,设置角标等方法
  126. @class XGNotificationConfigure;
  127. /**
  128. @brief 管理TPNS服务的对象,负责注册推送权限、消息的管理、调试模式的开关设置等
  129. */
  130. @interface XGPush : NSObject
  131. /**
  132. @brief 获取TPNS管理的单例对象
  133. @return TPNS对象
  134. */
  135. + (nonnull instancetype)defaultManager;
  136. /**
  137. @brief 关于TPNS SDK接口协议的对象
  138. */
  139. @property (weak, nonatomic, nullable, readonly) id<XGPushDelegate> delegate;
  140. /// 应用启动的代理对象
  141. /// @note 当SDK框架出现自动化处理的异常时,可以通过此属性进行设置,对应用代理对象处理逻辑进行补足
  142. @property (weak, nonatomic, nullable) id<UIApplicationDelegate> appDelegate;
  143. /**
  144. @brief 这个开关表明是否打印TPNS SDK的日志信息
  145. */
  146. @property (assign, getter=isEnableDebug) BOOL enableDebug;
  147. /**
  148. @brief 管理应用角标
  149. @note 需要在主线程调用
  150. */
  151. @property (nonatomic) NSInteger xgApplicationBadgeNumber;
  152. /**
  153. @brief 传递didFinishLaunchingWithOptions的launchOptions,用于推送拉起app"启动数"统计
  154. @note 在startXGWithAccessID之前调用,使用[launchOptions mutableCopy]传值
  155. */
  156. @property (nonatomic, strong) NSMutableDictionary *_Nullable launchOptions;
  157. /**
  158. @brief TPNS管理对象,管理推送的配置选项,例如,注册推送的样式
  159. */
  160. @property (nullable, strong, nonatomic) XGNotificationConfigure *notificationConfigure;
  161. #pragma mark - ********注册及反注册方法********
  162. /**
  163. @brief 通过使用在TPNS官网注册的应用的信息,启动TPNS服务
  164. @param accessID 通过TPNS管理台申请的 AccessID
  165. @param accessKey 通过TPNS管理台申请的 AccessKey
  166. @param delegate 回调对象
  167. @note 接口所需参数必须要正确填写,反之TPNS服务将不能正确为应用推送消息
  168. */
  169. - (void)startXGWithAccessID:(uint32_t)accessID accessKey:(nonnull NSString *)accessKey delegate:(nullable id<XGPushDelegate>)delegate;
  170. /**
  171. @brief 停止TPNS服务
  172. @note
  173. 调用此方法将导致当前设备不再接受TPNS服务推送的消息.如果再次需要接收TPNS服务的消息推送,则必须需要再次调用startXG:withAccessKey:delegate:方法重启TPNS服务
  174. */
  175. - (void)stopXGNotification;
  176. #pragma mark - ********其他相关方法********
  177. /**
  178. @brief 上报当前App角标数到TPNS服务器
  179. @param badgeNumber 应用的角标数,传递前请计算好结果值(业务逻辑或者其他SDK可能会影响角标数)
  180. @note 1.此接口是为了实现角标+1的功能,服务器会在这个数值基础上进行角标数新增的操作,调用成功之后,会覆盖之前值。
  181. 2.如果使用RestAPI推送,对应badge_type:-2时生效。
  182. 3.调用此接口不会改变当前角标值。
  183. */
  184. - (void)setBadge:(NSInteger)badgeNumber;
  185. /**
  186. @brief 查询设备通知权限是否被用户允许
  187. @param handler 查询结果的返回方法
  188. @note iOS 10 or later 回调是异步地执行
  189. */
  190. - (void)deviceNotificationIsAllowed:(nonnull void (^)(BOOL isAllowed))handler;
  191. /**
  192. @brief 查看SDK的版本
  193. @return sdk版本号
  194. */
  195. - (nonnull NSString *)sdkVersion;
  196. /**
  197. @brief 上报日志信息 (TPNS SDK1.2.4.1+)
  198. @param handler 异步地返回上报结果
  199. @note 1.回调参数可能会被触发多次,如果存在多个日志文件
  200. 2.回调的result, 上传成功为true, 失败为false
  201. 3.回调的errorMessage,如果上传成功,则返回日志文件地址。如果上传失败,则返回错误信息。
  202. */
  203. - (void)uploadLogCompletionHandler:(nullable void (^)(BOOL result, NSString *_Nullable errorMessage))handler;
  204. /**
  205. @brief 清除TPNS缓存 (TPNS SDK1.2.7.1+)
  206. @return 清除结果
  207. */
  208. - (BOOL)clearTPNSCache;
  209. @end
  210. #pragma mark - XGPushTokenManager代理,用于接收账号和标签操作的回调
  211. /**
  212. @brief 设备token绑定的类型,绑定指定类型之后,就可以在TPNS前端按照指定的类型进行指定范围的推送
  213. - XGPushTokenBindTypeNone: 当前设备token不绑定任何类型,可以使用token单推,或者是全量推送(不推荐使用 )
  214. - XGPushTokenBindTypeAccount: 当前设备token与账号绑定之后,可以使用账号推送
  215. - XGPushTokenBindTypeTag: 当前设备token与指定标签绑定之后,可以使用标签推送
  216. */
  217. typedef NS_ENUM(NSUInteger, XGPushTokenBindType) {
  218. XGPushTokenBindTypeNone = (0),
  219. XGPushTokenBindTypeAccount = (1 << 0),
  220. XGPushTokenBindTypeTag = (1 << 1)
  221. };
  222. /**
  223. @brief 定义了一组关于设备token绑定,解绑账号和标签的回调方法,用以监控绑定和解绑的情况
  224. */
  225. @protocol XGPushTokenManagerDelegate <NSObject>
  226. @optional
  227. #pragma mark - ********账号相关代理回调,TPNS SDK1.2.8.0+********
  228. /**
  229. @brief 对应upsertAccountsByDict:的回调(TPNS SDK1.2.9.0+)
  230. @param accountsDict 账号字典
  231. @param error 绑定账号的结果信息
  232. */
  233. - (void)xgPushDidUpsertAccountsByDict:(nonnull NSDictionary *)accountsDict error:(nullable NSError *)error;
  234. /**
  235. @brief 对应delAccountsByKeys:的回调(TPNS SDK1.2.9.0+)
  236. @param accountsKeys 账号集合
  237. @param error 解绑账号的结果信息
  238. */
  239. - (void)xgPushDidDelAccountsByKeys:(nonnull NSSet<NSNumber *> *)accountsKeys error:(nullable NSError *)error;
  240. /**
  241. @brief 对应clearAccounts的回调(TPNS SDK1.2.8.0+)
  242. @param error 清除账号的结果信息
  243. */
  244. - (void)xgPushDidClearAccountsError:(nullable NSError *)error;
  245. #pragma mark - ********标签相关代理回调,TPNS SDK1.2.8.0+********
  246. /**
  247. @brief 对应appendTags:的回调(TPNS SDK1.2.8.0+)
  248. @param tags 标签数组
  249. @param error 绑定标签的结果信息
  250. */
  251. - (void)xgPushDidAppendTags:(nonnull NSArray<NSString *> *)tags error:(nullable NSError *)error;
  252. /**
  253. @brief 对应delTags:的回调(TPNS SDK1.2.8.0+)
  254. @param tags 标签数组
  255. @param error 解绑标签的结果信息
  256. */
  257. - (void)xgPushDidDelTags:(nonnull NSArray<NSString *> *)tags error:(nullable NSError *)error;
  258. /**
  259. @brief 对应clearTags的回调(TPNS SDK1.2.8.0+)
  260. @param error 清除标签的结果信息
  261. */
  262. - (void)xgPushDidClearTagsError:(nullable NSError *)error;
  263. /**
  264. @brief 对应clearAndAppendTags:的回调(TPNS SDK1.2.8.0+)
  265. @param tags 标签数组
  266. @param error 更新标签的结果信息
  267. */
  268. - (void)xgPushDidClearAndAppendTags:(nonnull NSArray<NSString *> *)tags error:(nullable NSError *)error;
  269. /**
  270. @brief 对应queryTags:的回调
  271. @param tags 标签数组
  272. @param totalCount 绑定的所有标签总数
  273. @param error 查询标签的结果信息
  274. */
  275. - (void)xgPushDidQueryTags:(nullable NSArray<NSString *> *)tags totalCount:(NSUInteger)totalCount error:(nullable NSError *)error;
  276. #pragma mark - ********用户属性相关代理回调,个性化推送使用********
  277. /**
  278. @brief 对应upsertAttributes:的回调(TPNS SDK1.2.9.0+)
  279. @param attributes 用户属性
  280. @param keys 无效用户属性键的数组, 未在管理台配置
  281. @param error token对象绑定的结果信息
  282. */
  283. - (void)xgPushDidUpsertAttributes:(nonnull NSDictionary *)attributes invalidKeys:(nullable NSArray *)keys error:(nullable NSError *)error;
  284. /**
  285. @brief 对应delAttributes:的回调(TPNS SDK1.2.8.0+)
  286. @param attributeKeys 用户属性key组成的集合
  287. @param keys 无效用户属性键的数组, 未在管理台配置
  288. @param error token对象解绑的结果信息
  289. */
  290. - (void)xgPushDidDelAttributeKeys:(nonnull NSSet *)attributeKeys invalidKeys:(nullable NSArray *)keys error:(nullable NSError *)error;
  291. /**
  292. @brief 对应clearAttributes的回调(TPNS SDK1.2.8.0+)
  293. @param error token对象删除所有用户属性的结果信息
  294. */
  295. - (void)xgPushDidClearAttributesWithError:(nullable NSError *)error;
  296. /**
  297. @brief 对应clearAndAppendAttributes:的回调(TPNS SDK1.2.8.0+)
  298. @param attributes 用户属性
  299. @param keys 无效用户属性键的数组, 未在管理台配置
  300. @param error token对象更新的结果信息
  301. */
  302. - (void)xgPushDidClearAndAppendAttributes:(nonnull NSDictionary *)attributes invalidKeys:(nullable NSArray *)keys error:(nullable NSError *)error;
  303. #pragma mark - ********建议废弃的账号、标签相关代理回调********
  304. /**
  305. @brief 对应clearAndAppendAccounts:的回调(TPNS SDK1.2.9.0+)
  306. @param accountsDict 账号数组
  307. @param error 更新账号的结果信息
  308. */
  309. - (void)xgPushDidClearAndAppendAccountsByDict:(nonnull NSDictionary *)accountsDict
  310. error:(nullable NSError *)error
  311. __deprecated_msg("recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:");
  312. /**
  313. @brief 对应appendAccounts:的回调(TPNS SDK1.2.8.0+)
  314. @param accounts 账号数组
  315. @param error 绑定账号的结果信息
  316. */
  317. - (void)xgPushDidAppendAccounts:(nonnull NSArray<NSDictionary *> *)accounts
  318. error:(nullable NSError *)error
  319. __deprecated_msg("recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:");
  320. /**
  321. @brief 对应delAccounts:的回调(TPNS SDK1.2.8.0+)
  322. @param accounts 账号数组
  323. @param error 解绑账号的结果信息
  324. */
  325. - (void)xgPushDidDelAccounts:(nonnull NSArray<NSDictionary *> *)accounts
  326. error:(nullable NSError *)error
  327. __deprecated_msg("recommended to use delAccountsByKeys: to add accounts,and delegete update to xgPushDidDelAccountsByKeys:error:");
  328. /**
  329. @brief 对应clearAndAppendAccounts:的回调(TPNS SDK1.2.8.0+)
  330. @param accounts 账号数组
  331. @param error 更新账号的结果信息
  332. */
  333. - (void)xgPushDidClearAndAppendAccounts:(nonnull NSArray<NSDictionary *> *)accounts
  334. error:(nullable NSError *)error
  335. __deprecated_msg("recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:");
  336. /**
  337. @brief 监控token对象绑定的情况
  338. @param identifier token对象绑定的标识
  339. @param type token对象绑定的类型
  340. @param error token对象绑定的结果信息
  341. */
  342. - (void)xgPushDidBindWithIdentifier:(nonnull NSString *)identifier
  343. type:(XGPushTokenBindType)type
  344. error:(nullable NSError *)error
  345. __deprecated_msg(
  346. "recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:;use appendTags: to "
  347. "add tags, and delegete update to xgPushDidAppendTags:error:");
  348. /**
  349. @brief 监控token对象解绑的情况
  350. @param identifier token对象解绑的标识
  351. @param type token对象解绑的类型
  352. @param error token对象解绑的结果信息
  353. */
  354. - (void)xgPushDidUnbindWithIdentifier:(nonnull NSString *)identifier
  355. type:(XGPushTokenBindType)type
  356. error:(nullable NSError *)error
  357. __deprecated_msg("recommended to use delAccounts: to delete accounts,and delegete update to xgPushDidDelAccounts:error:; use delTags: to delete "
  358. "tags, and delegete update to xgPushDidDelTags:error:");
  359. /**
  360. @brief 监控token对象identifiers绑定的情况
  361. @param identifiers token对象绑定的标识
  362. @param type token对象绑定的类型
  363. @param error token对象绑定的结果信息
  364. */
  365. - (void)xgPushDidBindWithIdentifiers:(nonnull NSArray *)identifiers
  366. type:(XGPushTokenBindType)type
  367. error:(nullable NSError *)error
  368. __deprecated_msg(
  369. "recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:;use appendTags: to "
  370. "add tags, and delegete update to xgPushDidAppendTags:error:");
  371. /**
  372. @brief 监控token对象identifiers解绑的情况
  373. @param identifiers token对象解绑的标识
  374. @param type token对象解绑的类型
  375. @param error token对象解绑的结果信息
  376. */
  377. - (void)xgPushDidUnbindWithIdentifiers:(nonnull NSArray *)identifiers
  378. type:(XGPushTokenBindType)type
  379. error:(nullable NSError *)error
  380. __deprecated_msg("recommended to use delAccounts: to delete accounts,and delegete update to xgPushDidDelAccounts:error:; use delTags: to delete "
  381. "tags, and delegete update to xgPushDidDelTags:error:");
  382. /**
  383. @brief 监控token对象更新已绑定标识的情况
  384. @param identifiers token对象更新后的标识
  385. @param type token对象更新类型
  386. @param error token对象更新标识的结果信息
  387. */
  388. - (void)xgPushDidUpdatedBindedIdentifiers:(nonnull NSArray *)identifiers
  389. bindType:(XGPushTokenBindType)type
  390. error:(nullable NSError *)error
  391. __deprecated_msg("recommended to use upsertAccountsByDict: to add accounts,and delegete update to xgPushDidUpsertAccountsByDict:error:; use "
  392. "clearAndAppendTags: to clear and append tags, and delegete update to xgPushDidClearAndAppendTags:error:");
  393. /**
  394. @brief 监控清除token对象绑定标识的情况
  395. @param type token对象清除的类型
  396. @param error token对象清除标识的结果信息
  397. */
  398. - (void)xgPushDidClearAllIdentifiers:(XGPushTokenBindType)type
  399. error:(nullable NSError *)error
  400. __deprecated_msg("recommended to use clearAccounts to clear accounts,and delegete update to xgPushDidClearAccountsError:; use clearTags to clear "
  401. "tags, and delegete update to xgPushDidClearTagsError:");
  402. @end
  403. #pragma mark - XGPushTokenManager,提供账号和标签的绑定与解绑操作
  404. @interface XGPushTokenManager : NSObject
  405. /**
  406. @brief 创建设备token的管理对象,用来管理token的绑定与解绑操作
  407. @return 设备token管理对象
  408. @note 此类的 APIs 调用都是以 Token 在TPNS服务上完成注册为前提
  409. */
  410. + (nonnull instancetype)defaultTokenManager;
  411. - (nonnull instancetype)init NS_UNAVAILABLE;
  412. /**
  413. @brief 设备token管理操作的代理对象
  414. */
  415. @property (weak, nonatomic, nullable) id<XGPushTokenManagerDelegate> delegate;
  416. /**
  417. @brief 返回当前设备token的字符串,由苹果APNs生成
  418. */
  419. @property (copy, nonatomic, nullable, readonly) NSString *deviceTokenString;
  420. /**
  421. @brief 返回当前TPNS 服务生成的token字符串
  422. */
  423. @property (copy, nonatomic, nullable, readonly) NSString *xgTokenString;
  424. #pragma mark - ********账号相关方法,TPNS SDK1.2.8.0+********
  425. /**
  426. @brief 添加或更新账号(TPNS SDK1.2.9.0+)
  427. @param accountsDict 账号字典
  428. @note 若原来没有该类型账号,则添加;若原来有,则覆盖
  429. @note 账号类型和账号名称一起作为联合主键
  430. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  431. @note 需要使用字典类型,key为账号类型,value为账号,示例:@{@(accountType):@"account"};
  432. Objective-C的写法 : @{@(0):@"account0",@(1):@"account1"};
  433. Swift的写法:[NSNumber(0):@"account0",NSNumber(1):@"account1"]
  434. @note 账号类型详情可参考文档: https://cloud.tencent.com/document/product/548/50102
  435. */
  436. - (void)upsertAccountsByDict:(nonnull NSDictionary<NSNumber *, NSString *> *)accountsDict;
  437. /**
  438. @brief 添加或更新用户手机号,等于调用upsertAccountsByDict:@{@(1002):@"具体手机号"}。(TPNS SDK1.3.2.0+)
  439. @param phoneNumber E.164标准,格式为+[国家或地区码][手机号],例如+8613711112222。SDK内部加密传输。
  440. @note 若原来没有该手机号,则添加;若原来有,则覆盖
  441. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  442. @note 如需要删除手机号,调用delAccountsByKeys:[[NSSet alloc] initWithObjects:@(1002), nil]
  443. */
  444. - (void)upsertPhoneNumber:(nonnull NSString *)phoneNumber;
  445. /**
  446. @brief 删除账号(TPNS SDK1.2.9.0+)
  447. @param accountsKeys 账号类型组成的集合
  448. @note 删除指定账号类型下的所有账号
  449. @note 使用集合且key是固定要求
  450. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  451. */
  452. - (void)delAccountsByKeys:(nonnull NSSet<NSNumber *> *)accountsKeys;
  453. /**
  454. @brief 清空已有账号(TPNS SDK1.2.8.0+)
  455. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  456. */
  457. - (void)clearAccounts;
  458. #pragma mark - ********标签相关方法,TPNS SDK1.2.8.0+********
  459. /**
  460. @brief 添加标签((TPNS SDK1.2.8.0+)
  461. @param tags 标签数组
  462. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  463. @note tags为标签字符串数组,最多不超过500个(标签字符串不允许有空格或者是tab字符,长度不超过50)
  464. */
  465. - (void)appendTags:(nonnull NSArray<NSString *> *)tags;
  466. /**
  467. @brief 删除标签(TPNS SDK1.2.8.0+)
  468. @param tags 指定解绑标识,标签字符串不允许有空格或者是tab字符
  469. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用;若需要清除所有标识,建议使用 clearAllIdentifiers:;
  470. @note tags为标签字符串数组,最多不超过500个(标签字符串不允许有空格或者是tab字符,长度不超过50)
  471. */
  472. - (void)delTags:(nonnull NSArray<NSString *> *)tags;
  473. /**
  474. @brief 清空已有标签(TPNS SDK1.2.8.0+)
  475. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  476. */
  477. - (void)clearTags;
  478. /**
  479. @brief 清空已有标签,然后批量添加标签(TPNS SDK1.2.8.0+)
  480. @param tags 标签标识字符串数组,标签字符串不允许有空格或者是tab字符
  481. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  482. @note tags为标签字符串数组,最多不超过500个(标签字符串不允许有空格或者是tab字符,长度不超过50)
  483. */
  484. - (void)clearAndAppendTags:(nonnull NSArray<NSString *> *)tags;
  485. /**
  486. @brief 查询当前设备(tpns token为准)绑定的标签
  487. @param offset 此次查询的偏移大小
  488. @param limit 此次查询的分页大小, 最大200
  489. @note 举例:"limit 3 offset 1" 表示跳过1条数据,从第2条数据开始取,取3条数据,也就是取2,3,4三条数据
  490. 举例: offset为0,则返回最新的标签集合
  491. */
  492. - (void)queryTags:(NSUInteger)offset limit:(NSUInteger)limit;
  493. #pragma mark - ********用户属性相关方法,个性化推送使用********
  494. /**
  495.  @brief 添加或更新用户属性( key-value结构,若原来没有该key的用户属性value,则新增; 若原来有该key的用户属性value,则更新该value)(TPNS SDK1.2.8.0+)
  496.  @param attributes 用户属性字符串字典,字符串不允许有空格或者是tab字符
  497.  @note 需要先在管理台配置用户属性的键,才能操作成功
  498.  @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  499.  @note 字符串不允许有空格或者是tab字符
  500.  @note 使用字典且key是固定要求,Objective-C的写法 : @{@"gender": @"Female", @"age": @"29"};Swift的写法:["gender":"Female", "age": "29"]
  501.  */
  502. - (void)upsertAttributes:(nonnull NSDictionary<NSString *, NSString *> *)attributes;
  503. /**
  504.  @brief 删除用户属性(TPNS SDK1.2.8.0+)
  505. @param attributeKeys 用户属性key组成的集合
  506.  @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  507.  @note 需要先在管理台配置用户属性的键,才能操作成功
  508.  @note 字符串不允许有空格或者是tab字符
  509.  @note 使用集合且key是固定要求
  510.  */
  511. - (void)delAttributes:(nonnull NSSet<NSString *> *)attributeKeys;
  512. /**
  513.  @brief 清空已有用户属性(TPNS SDK1.2.8.0+)
  514.  @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  515.  */
  516. - (void)clearAttributes;
  517. /**
  518.  @brief 清空已有用户属性,然后批量添加用户属性(TPNS SDK1.2.8.0+)
  519.  @param attributes 用户属性字符串字典,字符串不允许有空格或者是tab字符
  520.  @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  521.  @note 需要先在管理台配置用户属性的键,才能操作成功
  522.  @note 字符串不允许有空格或者是tab字符
  523.  @note 使用字典且key是固定要求,Objective-C的写法 : @{@"gender": @"Female", @"age": @"29"};Swift的写法:["gender":"Female", "age": "29"]
  524.  */
  525. - (void)clearAndAppendAttributes:(nonnull NSDictionary<NSString *, NSString *> *)attributes;
  526. #pragma mark - ********数据分析相关,需要集成XGMTACloud.framework********
  527. /**
  528. @brief 自定义事件上报
  529. @param eventID 事件ID
  530. @param kvs 键值对,例如@{@"para1": @"value1" }
  531. */
  532. - (void)trackCustomKeyValueEvent:(nonnull NSString *)eventID kvs:(nullable NSDictionary *)kvs;
  533. @end
  534. #pragma mark - XGNotificationAction,可以在通知栏中点击的事件对象
  535. /**
  536. @brief 点击行为对象的属性配置
  537. - XGNotificationActionOptionNone: 无
  538. - XGNotificationActionOptionAuthenticationRequired: 需要认证的选项
  539. - XGNotificationActionOptionDestructive: 具有破坏意义的选项
  540. - XGNotificationActionOptionForeground: 打开应用的选项
  541. */
  542. typedef NS_ENUM(NSUInteger, XGNotificationActionOptions) {
  543. XGNotificationActionOptionNone = (0),
  544. XGNotificationActionOptionAuthenticationRequired = (1 << 0),
  545. XGNotificationActionOptionDestructive = (1 << 1),
  546. XGNotificationActionOptionForeground = (1 << 2)
  547. };
  548. /**
  549. * @brief 定义了一个可以在通知栏中点击的事件对象
  550. */
  551. @interface XGNotificationAction : NSObject
  552. /**
  553. @brief 在通知消息中创建一个可以点击的事件行为
  554. @param identifier 行为唯一标识
  555. @param title 行为名称
  556. @param options 行为支持的选项
  557. @return 行为对象
  558. @note 通知栏带有点击事件的特性,只有在iOS 8+、macOS 10.14+ 以上支持,iOS 8、macOS10.14 or earlier的版本,此方法返回空
  559. */
  560. + (nullable id)actionWithIdentifier:(nonnull NSString *)identifier title:(nonnull NSString *)title options:(XGNotificationActionOptions)options;
  561. /**
  562. @brief 点击行为的标识
  563. */
  564. @property (nullable, nonatomic, copy, readonly) NSString *identifier;
  565. /**
  566. @brief 点击行为的标题
  567. */
  568. @property (nullable, nonatomic, copy, readonly) NSString *title;
  569. /**
  570. @brief 点击行为的特性
  571. */
  572. @property (readonly, nonatomic) XGNotificationActionOptions options;
  573. @end
  574. #pragma mark - XGNotificationCategory,管理一组关联的Action,以实现不同分类对应不同的Actions
  575. /**
  576. @brief 分类对象的属性配置
  577. - XGNotificationCategoryOptionNone: 无
  578. - XGNotificationCategoryOptionCustomDismissAction: 发送消失事件给UNUserNotificationCenter(iOS 10+、macOS 10.14+ or later)对象
  579. - XGNotificationCategoryOptionAllowInCarPlay: 允许CarPlay展示此类型的消息
  580. */
  581. typedef NS_OPTIONS(NSUInteger, XGNotificationCategoryOptions) {
  582. XGNotificationCategoryOptionNone = (0),
  583. XGNotificationCategoryOptionCustomDismissAction = (1 << 0),
  584. XGNotificationCategoryOptionAllowInCarPlay = (1 << 1)
  585. };
  586. /**
  587. * 通知栏中消息指定的分类,分类主要用来管理一组关联的Action,以实现不同分类对应不同的Actions
  588. */
  589. @interface XGNotificationCategory : NSObject
  590. /**
  591. @brief 创建分类对象,用以管理通知栏的Action对象
  592. @param identifier 分类对象的标识
  593. @param actions 当前分类拥有的行为对象组
  594. @param intentIdentifiers 用以表明可以通过Siri识别的标识
  595. @param options 分类的特性
  596. @return 管理点击行为的分类对象
  597. @note 通知栏带有点击事件的特性,只有在iOS 8+ 、macOS 10.14+ 以上支持,iOS 8 、macOS 10.14 or earlier的版本,此方法返回空
  598. */
  599. + (nullable id)categoryWithIdentifier:(nonnull NSString *)identifier
  600. actions:(nullable NSArray<id> *)actions
  601. intentIdentifiers:(nullable NSArray<NSString *> *)intentIdentifiers
  602. options:(XGNotificationCategoryOptions)options;
  603. /**
  604. @brief 分类对象的标识
  605. */
  606. @property (nonnull, readonly, copy, nonatomic) NSString *identifier;
  607. /**
  608. @brief 分类对象拥有的点击行为组
  609. */
  610. @property (nonnull, readonly, copy, nonatomic) NSArray<XGNotificationAction *> *actions;
  611. /**
  612. @brief 可用以Siri意图的标识组
  613. */
  614. @property (nullable, readonly, copy, nonatomic) NSArray<NSString *> *intentIdentifiers;
  615. /**
  616. @brief 分类的特性
  617. */
  618. @property (readonly, nonatomic) XGNotificationCategoryOptions options;
  619. @end
  620. #pragma mark - XGNotificationConfigure,配置消息通知的样式和行为特性
  621. /**
  622. @brief 注册通知支持的类型
  623. - XGUserNotificationTypeNone: 无
  624. - XGUserNotificationTypeBadge: 支持应用角标
  625. - XGUserNotificationTypeSound: 支持铃声
  626. - XGUserNotificationTypeAlert: 支持弹框
  627. - XGUserNotificationTypeCarPlay: 支持CarPlay,iOS 10.0+
  628. - XGUserNotificationTypeCriticalAlert: 支持紧急提醒播放声音, iOS 12.0+
  629. - XGUserNotificationTypeProvidesAppNotificationSettings: 让系统在应用内通知设置中显示按钮, iOS 12.0+
  630. - XGUserNotificationTypeProvisional: 能够将非中断通知临时发布到 Notification Center, iOS 12.0+
  631. - XGUserNotificationTypeNewsstandContentAvailability: 支持 Newsstand, iOS 3.0–8.0
  632. */
  633. typedef NS_OPTIONS(NSUInteger, XGUserNotificationTypes) {
  634. XGUserNotificationTypeNone = (0),
  635. XGUserNotificationTypeBadge = (1 << 0),
  636. XGUserNotificationTypeSound = (1 << 1),
  637. XGUserNotificationTypeAlert = (1 << 2),
  638. XGUserNotificationTypeCarPlay = (1 << 3),
  639. XGUserNotificationTypeCriticalAlert = (1 << 4),
  640. XGUserNotificationTypeProvidesAppNotificationSettings = (1 << 5),
  641. XGUserNotificationTypeProvisional = (1 << 6),
  642. XGUserNotificationTypeNewsstandContentAvailability = (1 << 3)
  643. };
  644. /**
  645. @brief 管理推送消息通知栏的样式和特性
  646. */
  647. @interface XGNotificationConfigure : NSObject
  648. /**
  649. @brief 配置通知栏对象,主要是为了配置消息通知的样式和行为特性
  650. @param categories 通知栏中支持的分类集合
  651. @param types 注册通知的样式
  652. @return 配置对象
  653. */
  654. + (nullable instancetype)configureNotificationWithCategories:(nullable NSSet<id> *)categories types:(XGUserNotificationTypes)types;
  655. - (nonnull instancetype)init NS_UNAVAILABLE;
  656. /**
  657. @brief 返回消息通知栏配置对象
  658. */
  659. @property (readonly, nullable, strong, nonatomic) NSSet<XGNotificationCategory *> *categories;
  660. /**
  661. @brief 返回注册推送的样式类型
  662. */
  663. @property (readonly, nonatomic) XGUserNotificationTypes types;
  664. /**
  665. @brief 默认的注册推送的样式类型
  666. */
  667. @property (readonly, nonatomic) XGUserNotificationTypes defaultTypes;
  668. @end
  669. #pragma mark - XGPush Deprecated
  670. /**
  671. @brief 管理TPNS服务的对象,负责注册推送权限、消息的管理、调试模式的开关设置等
  672. */
  673. @interface XGPush (Deprecated)
  674. /**
  675. @brief 返回TPNS服务的状态
  676. */
  677. @property (assign, readonly)
  678. BOOL xgNotificationStatus __deprecated_msg("Instead, you should get the status by xgPushDidRegisteredDeviceToken:xgToken:error:");
  679. /**
  680. @brief 设备在TPNS服务中的是否处于注册状态
  681. */
  682. @property (assign, readonly)
  683. BOOL deviceDidRegisteredXG __deprecated_msg("Instead, you should get the status by xgPushDidRegisteredDeviceToken:xgToken:error:");
  684. /**
  685. @brief 通过使用在TPNS官网注册的应用的信息,启动TPNS服务
  686. @param appID 通过TPNS管理台申请的 AccessID
  687. @param appKey 通过TPNS管理台申请的 AccessKey
  688. @param delegate 回调对象
  689. @note 接口所需参数必须要正确填写,反之TPNS服务将不能正确为应用推送消息
  690. */
  691. - (void)startXGWithAppID:(uint32_t)appID
  692. appKey:(nonnull NSString *)appKey
  693. delegate:(nullable id<XGPushDelegate>)delegate __deprecated_msg("You should use startXGWithAccessID instead");
  694. #if TARGET_OS_IPHONE
  695. - (void)reportXGNotificationInfo:(nonnull NSDictionary *)info __deprecated_msg("You should no longer call it, SDK handles it automatically.");
  696. #endif
  697. /**
  698. @brief 上报推送消息的用户行为
  699. @param response 用户行为
  700. @note 此接口即统计推送消息中开发者预先设置或者是系统预置的行为标识,可以了解到用户是如何处理推送消息的,又统计消息的点击次数
  701. */
  702. - (void)reportXGNotificationResponse:(nullable UNNotificationResponse *)response __IOS_AVAILABLE(10.0)__OSX_AVAILABLE(10.14)
  703. __deprecated_msg("You should no longer call it, SDK handles it automatically.");
  704. @end
  705. #pragma mark - XGPushTokenManager Deprecated
  706. @interface XGPushTokenManager (Deprecated)
  707. /**
  708. @brief 创建设备token的管理对象,用来管理token的绑定与解绑操作
  709. @return 设备token管理对象
  710. @note 此类的 APIs 调用都是以 Token 在TPNS服务上完成注册为前提
  711. */
  712. #pragma mark - ********建议废弃的账号、标签相关方法********
  713. /**
  714. @brief 清空已有账号,然后批量添加账号(TPNS SDK1.2.9.0+)
  715. @param accountsDict 账号字典
  716. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  717. @note 需要使用字典类型,key为账号类型,value为账号,示例:@{@(accountType):@"account"};
  718. Objective-C的写法 : @{@(0):@"account0",@(1):@"account1"};
  719. Swift的写法:[NSNumber(0):@"account0",NSNumber(1):@"account1"]
  720. */
  721. - (void)clearAndAppendAccountsByDict:(nonnull NSDictionary<NSNumber *, NSString *> *)accountsDict
  722. __deprecated_msg("recommended to use upsertAccountsByDict:");
  723. /**
  724. @brief 添加账号(TPNS SDK1.2.8.0+)
  725. @param accounts 账号数组
  726. @note 账号类型和账号名称一起作为联合主键
  727. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  728. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"accountType":@(0),@"account":identifier}];
  729. Swift的写法:[["accountType":NSNumber(0),"account":identifier]]
  730. */
  731. - (void)appendAccounts:(nonnull NSArray<NSDictionary *> *)accounts __deprecated_msg("recommended to use upsertAccountsByDict:");
  732. /**
  733. @brief 删除账号(TPNS SDK1.2.9.0+)
  734. @param accounts 账号数组
  735. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"accountType":@(0),@"account":identifier}];
  736. Swift的写法:[["accountType":NSNumber(0),"account":identifier]]
  737. */
  738. - (void)delAccounts:(nonnull NSArray<NSDictionary *> *)accounts __deprecated_msg("recommended to use delAccountsByKeys:");
  739. /**
  740. @brief 清空已有账号,然后批量添加账号(TPNS SDK1.2.8.0+)
  741. @param accounts 账号数组
  742. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  743. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"accountType":@(0),@"account":identifier}];
  744. Swift的写法:[["accountType":NSNumber(0),"account":identifier]]
  745. */
  746. - (void)clearAndAppendAccounts:(nonnull NSArray<NSDictionary *> *)accounts __deprecated_msg("recommended to use upsertAccountsByDict:");
  747. /**
  748. @brief 为token对象设置绑定类型和标识
  749. @param identifier 指定绑定标识
  750. @param type 指定绑定类型
  751. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  752. @note 对于标签操作,标签字符串不允许有空格或者是tab字符
  753. */
  754. - (void)bindWithIdentifier:(nonnull NSString *)identifier
  755. type:(XGPushTokenBindType)type __deprecated_msg("recommended to use upsertAccountsByDict: or appendTags:");
  756. /**
  757. @brief 根据类型和标识为token对象解绑
  758. @param identifier 指定解绑标识
  759. @param type 指定解绑类型
  760. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用;若需要清除所有标识,建议使用 clearAllIdentifiers:
  761. @note 对于标签操作,标签字符串不允许有空格或者是tab字符
  762. */
  763. - (void)unbindWithIdentifer:(nonnull NSString *)identifier
  764. type:(XGPushTokenBindType)type __deprecated_msg("recommended to use delAccounts: or delTags:");
  765. /**
  766. @brief 为token对象设置绑定类型和标识
  767. @param identifiers 指定绑定标识,标签字符串不允许有空格或者是tab字符
  768. @param type 指定绑定类型
  769. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  770. @note 对于标签操作identifiers为标签字符串数组(标签字符串不允许有空格或者是tab字符)
  771. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"account":identifier, @"accountType":@(0)}];
  772. Swift的写法:[["account":identifier, "accountType":NSNumber(0)]]
  773. */
  774. - (void)bindWithIdentifiers:(nonnull NSArray *)identifiers
  775. type:(XGPushTokenBindType)type __deprecated_msg("recommended to use upsertAccountsByDict: or appendTags:");
  776. /**
  777. @brief 根据类型和标识为token对象解绑
  778. @param identifiers 指定解绑标识,标签字符串不允许有空格或者是tab字符
  779. @param type 指定解绑类型
  780. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用;若需要清除所有标识,建议使用 clearAllIdentifiers:;
  781. @note 对于标签操作identifiers为标签字符串数组(标签字符串不允许有空格或者是tab字符)
  782. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"account":identifier, @"accountType":@(0)}];
  783. Swift的写法:[["account":identifier, "accountType":NSNumber(0)]]
  784. */
  785. - (void)unbindWithIdentifers:(nonnull NSArray *)identifiers
  786. type:(XGPushTokenBindType)type __deprecated_msg("recommended to use delAccounts: or delTags:");
  787. /**
  788. @brief 根据类型,覆盖原有的标识;若之前没有绑定标识,则会执行新增标识
  789. @param identifiers 标签标识字符串数组,标签字符串不允许有空格或者是tab字符
  790. @param type 标识类型
  791. @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  792. @note 对于标签操作,标签字符串不允许有空格或者是tab字符
  793. @note 对于账号操作,需要使用字典数组且key是固定要求,Objective-C的写法 : @[@{@"account":identifier, @"accountType":@(0)}];
  794. Swift的写法:[["account":identifier, "accountType":NSNumber(0)]]
  795. */
  796. - (void)updateBindedIdentifiers:(nonnull NSArray *)identifiers
  797. bindType:(XGPushTokenBindType)type __deprecated_msg("recommended to use upsertAccountsByDict: or clearAndAppendTags:");
  798. /**
  799.  @brief 清除所有用户属性
  800.  @note 此接口应该在xgPushDidRegisteredDeviceToken:xgToken:error:返回正确之后被调用
  801.  */
  802. - (void)clearAllIdentifiers:(XGPushTokenBindType)type __deprecated_msg("recommended to use clearAccounts or clearTags");
  803. @end