Commit 3c4f4385 by pierce

消息推送相关的配送

parent b83b878b
...@@ -184,6 +184,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -184,6 +184,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取背包最后更新的时间 /// 获取背包最后更新的时间
+ (NSString *)fus_URL_requestBackpackTimeUpdateGet; + (NSString *)fus_URL_requestBackpackTimeUpdateGet;
// 用户点击个推消息-记录
+ (NSString *)fus_URL_UploadPushClickLog;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -288,4 +288,9 @@ ...@@ -288,4 +288,9 @@
} }
// 用户点击个推消息-记录
+ (NSString *)fus_URL_UploadPushClickLog {
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/stat/clickPushMsg/log"];
}
@end @end
...@@ -176,32 +176,21 @@ ...@@ -176,32 +176,21 @@
// 重置重试次数 // 重置重试次数
_retryCount = 0; self.retryCount = 0;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData *token = [[NSUserDefaults standardUserDefaults] objectForKey:FUSChatUDKeys.fus_DEVICE_TOKEN_DATA];
[[EMClient sharedClient] bindDeviceToken:token];
[[EMClient sharedClient] registerForRemoteNotificationsWithDeviceToken:token completion:^(EMError *aError) {
FUSLogInfo(@"");
}];
// 设置离线推送 [self fus_bindAPNsToken];
[[EMClient sharedClient].pushManager updatePushDisplayName:[FUSCacheDataShare shareStore].userDetailInfo.nickname];
[[EMClient sharedClient].pushManager updatePushDisplayStyle:EMPushDisplayStyleMessageSummary];
});
} failure:^(NSString *errorMsg) { } failure:^(NSString *errorMsg) {
// 重试次数加1 // 重试次数加1
_retryCount ++; self.retryCount ++;
if (_retryCount <= 3) { // 重试3次 if (self.retryCount <= 3) { // 重试3次
[self fus_autoLoginWithAccount:account]; [self fus_autoLoginWithAccount:account];
}else{ }else{
// 重置重试次数 // 重置重试次数
_retryCount = 0; self.retryCount = 0;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
// 更新到最新的离线会话 // 更新到最新的离线会话
...@@ -211,6 +200,21 @@ ...@@ -211,6 +200,21 @@
}]; }];
} }
- (void)fus_bindAPNsToken {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData *token = [[NSUserDefaults standardUserDefaults] objectForKey:FUSChatUDKeys.fus_DEVICE_TOKEN_DATA];
[[EMClient sharedClient] bindDeviceToken:token];
[[EMClient sharedClient] registerForRemoteNotificationsWithDeviceToken:token completion:^(EMError *aError) {
FUSLogInfo(@"");
}];
// 设置离线推送
[[EMClient sharedClient].pushManager updatePushDisplayName:[FUSCacheDataShare shareStore].userDetailInfo.nickname];
[[EMClient sharedClient].pushManager updatePushDisplayStyle:EMPushDisplayStyleMessageSummary];
});
}
- (void)fus_logOffWithSuccess:(void(^)(void))success failure:(void(^)(void))failure - (void)fus_logOffWithSuccess:(void(^)(void))success failure:(void(^)(void))failure
{ {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment