环信推送离线消息 需要显示消息内容,需要更新一下环信的的推送设置,在appdelegate里面接受apns推送消息的回调方法 - (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:
(void (^)(UIBackgroundFetchResult))completionHandler
里面 代码如下:
EMPushOptions *options = [[EMClient sharedClient] pushOptions];
options.displayStyle = EMPushDisplayStyleMessageSummary;
options.displayName = [userInfo objectForKey:@"f"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
EMError *error = nil;
error = [[EMClient sharedClient] updatePushOptionsToServer];
});