测试了下在控制台发送推送,应用进程杀死后也能收到推送。但是对方应用发送过来的消息收不到离线消息推送。测试机三星GALAXY S5 小米4 vivo Y33 都收不到
初始化操作
AVOSCloud.initialize(getApplicationContext(),"yiq7Vj8hWhKldyg0bD19BNVo-gzGzoHsz","T5pKTADBUiUIKEF9QGDLEW2Q");
AVIMMessageManager.registerAVIMMessageType(UhsShareMessage.class);
AVOSCloud.setDebugLogEnabled(true);
AVIMClient.setOfflineMessagePush(true);
PushService.setDefaultPushCallback(this, LoginActivity.class);
AVInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
public void done(AVException e) {
if (e == null) {
// 保存成功
installationId = AVInstallation.getCurrentInstallation().getInstallationId();
// 关联 installationId 到用户表等操作……
} else {
// 保存失败,输出错误信息
}
}
});
添加离线消息内容
AVIMMessageOption messageOption = new AVIMMessageOption();
messageOption.setPushData(str);
mConversation.sendMessage(msg, messageOption, new AVIMConversationCallback() {
@Override
public void done(AVIMException e) {
if (e == null) {
Log.e("info", "发送成功");
getChatDetails();
} else {
Log.e("info", "发送" + e.getMessage());
}
}
});
注册服务
service android:name="com.avos.avoscloud.PushService"
receiver android:name="com.avos.avoscloud.AVBroadcastReceiver"
intent-filter
action android:name="android.intent.action.BOOT_COMPLETED"
action android:name="android.intent.action.USER_PRESENT"
action android:name="android.net.conn.CONNECTIVITY_CHANGE"
intent-filter
receiver

您好,应用杀死后,离线消息自动走推送推送的功能,Android 还没有实现,正在进行中,我们将尽快实现。

具体什么时候可以实现啊?你们有需求周期么?急 smile

大概会在 6 月中旬的时候上线。

请问现在已经实现了么

您好,除了华为之外,小米/魅族都已经上线。
华为还没有的原因是在和华为对接的过程中,遇到了华为的 Bug,我们目前正在积极和华为沟通,争取在华为上也能尽快上线。

是不是要启用混合推送才行

是的,要启用混合推送