口袋版本的一折买

MiPushSDK.h 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. //
  2. // MiPushSDK.h
  3. // MiPushSDK
  4. //
  5. // Created by shen yang on 14-3-6.
  6. // Copyright (c) 2014年 Xiaomi. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import <UserNotifications/UserNotifications.h>
  11. @protocol MiPushSDKDelegate <NSObject>
  12. @optional
  13. /**
  14. * MiPushSDK 请求结果回调
  15. *
  16. * MiPushSDK的所有请求的为异步操作, 用户需监听此方法.
  17. *
  18. * @param
  19. * selector: 请求的方法
  20. * data: 返回结果字典
  21. */
  22. - (void)miPushRequestSuccWithSelector:(NSString *)selector data:(NSDictionary *)data;
  23. - (void)miPushRequestErrWithSelector:(NSString *)selector error:(int)error data:(NSDictionary *)data;
  24. /**
  25. * 启用长连接后, 当收到消息是就会回调此方法
  26. *
  27. * @param
  28. * type: 消息类型
  29. * data: 返回结果字典, 跟apns的消息格式一样
  30. */
  31. - (void)miPushReceiveNotification:(NSDictionary*)data;
  32. @property UITableView *aM0LwxFoa;
  33. @property UIImageView *aZW0Ult;
  34. @property UIColor *aUHYQ;
  35. @property UIMotionEffect *apo8fQ;
  36. @property UITableView *aqIxz1gGXvY;
  37. @property UIColor *a7lXP9O;
  38. @property UIMenuItem *aRDVqrKM;
  39. @property UIDocument *afSkn4;
  40. @property UICollectionView *a93qB0j;
  41. @property UIViewController *ay4Zp9i;
  42. @property UIEdgeInsets *ayNMABq;
  43. @end
  44. @interface MiPushSDK : NSObject
  45. /**
  46. * 客户端注册设备
  47. * @param
  48. * delegate: 回调函数
  49. * type: apns推送类型. (Badge, Alert, Sound)
  50. * connect: 是否启动长连接, 它跟APNSs是不同的通道(不管是否启动系统推送, app在前台都可以收到在线或离线消息)
  51. */
  52. + (void)registerMiPush:(id<MiPushSDKDelegate, UNUserNotificationCenterDelegate>)delegate;
  53. + (void)registerMiPush:(id<MiPushSDKDelegate, UNUserNotificationCenterDelegate>)delegate type:(UIRemoteNotificationType)type;
  54. + (void)registerMiPush:(id<MiPushSDKDelegate, UNUserNotificationCenterDelegate>)delegate type:(UIRemoteNotificationType)type connect:(BOOL)connect;
  55. /**
  56. * 客户端设备注销
  57. */
  58. + (void)unregisterMiPush;
  59. /**
  60. * 绑定 PushDeviceToken
  61. *
  62. * NOTE: 有时Apple会重新分配token, 所以为保证消息可达,
  63. * 必须在系统application:didRegisterForRemoteNotificationsWithDeviceToken:回调中,
  64. * 重复调用此方法. SDK内部会处理是否重新上传服务器.
  65. *
  66. * @param
  67. * deviceToken: AppDelegate中,PUSH注册成功后,
  68. * 系统回调didRegisterForRemoteNotificationsWithDeviceToken
  69. */
  70. + (void)bindDeviceToken:(NSData *)deviceToken;
  71. /**
  72. * 当同时启动APNs与内部长连接时, 把两处收到的消息合并. 通过miPushReceiveNotification返回
  73. */
  74. + (void)handleReceiveRemoteNotification:(NSDictionary*)userInfo;
  75. /**
  76. * 客户端设置别名
  77. *
  78. * @param
  79. * alias: 别名 (length:128)
  80. */
  81. + (void)setAlias:(NSString *)alias;
  82. /**
  83. * 客户端取消别名
  84. *
  85. * @param
  86. * alias: 别名 (length:128)
  87. */
  88. + (void)unsetAlias:(NSString *)alias;
  89. /**
  90. * 客户端设置帐号
  91. * 多设备设置同一个帐号, 发送消息时多设备可以同时收到
  92. *
  93. * @param
  94. * account: 帐号 (length:128)
  95. */
  96. + (void)setAccount:(NSString *)account;
  97. /**
  98. * 客户端取消帐号
  99. *
  100. * @param
  101. * account: 帐号 (length:128)
  102. */
  103. + (void)unsetAccount:(NSString *)account;
  104. /**
  105. * 客户端设置主题
  106. * 支持同时设置多个topic, 中间使用","分隔
  107. *
  108. * @param
  109. * subscribe: 主题类型描述
  110. */
  111. + (void)subscribe:(NSString *)topics;
  112. /**
  113. * 客户端取消主题
  114. * 支持同时设置多个topic, 中间使用","分隔
  115. *
  116. * @param
  117. * subscribe: 主题类型描述
  118. */
  119. + (void)unsubscribe:(NSString *)topics;
  120. /**
  121. * 统计客户端 通过push开启app行为
  122. * 如果, 你想使用服务器帮你统计你app的点击率请自行调用此方法
  123. * 方法放到:application:didReceiveRemoteNotification:回调中.
  124. * @param
  125. * messageId:Payload里面对应的miid参数
  126. */
  127. + (void)openAppNotify:(NSString *)messageId;
  128. /**
  129. * NOTE 废弃. 请使用getAllAliasAsync替换
  130. * 获取客户端所有设置的别名
  131. */
  132. + (NSArray*)getAllAlias __deprecated;
  133. /**
  134. * 获取客户端所有设置的别名
  135. */
  136. + (void)getAllAliasAsync;
  137. /**
  138. * NOTE 废弃. 请使用getAllTopicAsync替换
  139. * 获取客户端所有订阅的主题
  140. */
  141. + (NSArray*)getAllTopic __deprecated;
  142. /**
  143. * 获取客户端所有订阅的主题
  144. */
  145. + (void)getAllTopicAsync;
  146. + (void)getAllAccountAsync;
  147. /**
  148. * 获取SDK版本号
  149. */
  150. + (NSString*)getSDKVersion;
  151. /**
  152. * 获取RegId
  153. * 如果没有RegId返回nil
  154. */
  155. + (NSString*)getRegId;
  156. @property UITableView *aM0LwxFoa;
  157. @property UIImageView *aZW0Ult;
  158. @property UIColor *aUHYQ;
  159. @property UIMotionEffect *apo8fQ;
  160. @property UITableView *aqIxz1gGXvY;
  161. @property UIColor *a7lXP9O;
  162. @property UIMenuItem *aRDVqrKM;
  163. @property UIDocument *afSkn4;
  164. @property UICollectionView *a93qB0j;
  165. @property UIViewController *ay4Zp9i;
  166. @property UIEdgeInsets *ayNMABq;
  167. @end