差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
im:ios:apns:content [2019/12/18 10:54] huanxinfudh [iOS 发送] |
im:ios:apns:content [2020/06/28 07:32] shenchong [显示详情] |
||
---|---|---|---|
行 66: | 行 66: | ||
{ | { | ||
"aps":{ | "aps":{ | ||
- | "alert":"您有一条新消息", | + | "alert":{ |
+ | "body":"您有一条新消息" | ||
+ | }, | ||
"badge":1, | "badge":1, | ||
"sound":"default" | "sound":"default" | ||
行 92: | 行 94: | ||
{ | { | ||
"aps":{ | "aps":{ | ||
- | "alert":"ApnsName:xxxx", | + | "alert":{ |
+ | "body":"ApnsName:xxxx" | ||
+ | }, | ||
"badge":1, | "badge":1, | ||
"sound":"default" | "sound":"default" | ||
行 624: | 行 628: | ||
<code> | <code> | ||
- | EMChatText *txt = [[EMChatText alloc] initWithText:@"test"]; | + | EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:@"test"]; |
- | EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithChatObject:txt]; | + | EMMessage *message = [[EMMessage alloc] initWithConversationID:@"6006" from:@"6001" to:@"6006" body:body ext:nil]; |
- | EMMessage *msg = [[EMMessage alloc] initWithReceiver:@"6001" bodies:@[body]]; | + | message.ext = @{@"em_force_notification":@YES}; |
- | // 设置自定义扩展字段 | + | message.chatType = EMChatTypeChat; // 设置消息类型 |
- | msg.ext = @{@"em_force_notification":@YES}; | + | // 发送消息示例 |
- | // 发送消息 | + | [EMClient.sharedClient.chatManager sendMessage:message progress:nil completion:nil]; |
- | [[EaseMob sharedInstance].chatManager asyncSendMessage:msg progress:nil]; | + | |
</code> | </code> | ||