rammus
rammus copied to clipboard
推送消息能收到,推送通知无法收到
User authored notification.
[CloudPush Verbose]: appKey/appSecret changed, clear store info.
[CloudPush Debug]: Network status changed.
[CloudPush Debug]: Request url is: https://mpush-api.aliyun.com/config
[CloudPush Debug]: Connect to network, status: 1
[CloudPush Debug]: Request url is: https://mpush-api.aliyun.com/sid
[CloudPush Debug]: Request url is: https://mpush-api.aliyun.com/active
[CloudPush Debug]: Session init success.
[CloudPush Debug]: Connect to AS, IP: ********, Port: 443
[CloudPush Debug]: CCP socket start monitor reading and writing.
[CloudPush Debug]: Start CCP protocol shake hands.
[CloudPush Debug]: CCP protocol shake hands, send auth info, waiting for ack.
[CloudPush Debug]: MPChannelStatusConnecting
[CloudPush Debug]: CCP connect ack statusCode is 0
Push SDK init success, deviceId: ae0dc93de9544cfe97cae875d2d297cb.
[CloudPush Debug]: CCP channel connected success time: Mar 22 2021 18:53:17
[CloudPush Debug]: CCP channel connected, cancel timeout timer.
[CloudPush Debug]: AS connect ack, seq: 1, statusCode: 0
[CloudPush Debug]: Push message.
[CloudPush Debug]: Receive message, title: title, content: content
[CloudPush Debug]: Push message.
[CloudPush Debug]: Receive message, title: test, content: testccccc
[CloudPush Debug]: Push message.
[CloudPush Debug]: Receive message, title: 13212312, content: 1231231
[CloudPush Debug]: Push message.
[CloudPush Debug]: Receive message, title: test, content: testaa
[CloudPush Debug]: Push message.
[CloudPush Debug]: Receive message, title: 12313123, content: 12312313
以上是推送的日志,IOS设备上,推送的消息能收到,但是推送的通知无法收到
// 初始化阿里云推送服务结果回调(可能多次调用: 调用不成功,根据重调机制调用)
initCloudChannelResult.listen((data) {
print("----------->initCloudChannelResult ${data.toString()}");
});
/// 接收服务端推送消息
/// 消息不会弹窗,而是回调该方法。
onMessageArrived.listen((data) {
print("---------> onMessageArrived -> ${data.toString()}");
});
///客户端接收到通知后,回调该方法。
onNotification.listen((data) {
print("-----------> onNotification ${data.toString()}");
});
/// 打开APP通知回调
onNotificationOpened.listen((data) {
print("-----------> onNotificationOpened ${data.toString()} 被点了");
});
/// App通知被删除回调
onNotificationRemoved.listen((data) {
print("-----------> onNotificationRemoved ${data.toString()} 被删除了");
});
/// 打开无跳转逻辑(open=4)通知时回调该方法(v2.3.2及以上版本支持),
/// 通知打开上报由SDK自动完成。
onNotificationClickedWithNoAction.listen((data) {
print("----------> onNotificationClickedWithNoAction ${data.toString()}");
});
/// 当用户创建自定义通知样式,并且设置推送应用内到达不创建通知弹窗时调用该回调,
/// 且此时不调用onNotification回调(v2.3.3及以上版本支持)
onNotificationReceivedInApp.listen((data) {
print("-----------> onNotificationReceivedInApp ${data.toString()}");
});
我的也是,阿里控制台显示已推送,但没有收到,也没任何错误信息.

我的是xcode没有添加这个,在target-> sign&Capabilities-> +Capability 里 添加 Push Notifications后,可以收到推送了. @VFiee
![]()
我的是xcode没有添加这个,在target-> sign&Capabilities-> +Capability 里 添加 Push Notifications后,可以收到推送了. @VFiee
好的,我们已经更换了推送服务商,有时间我再启一个demo验证一下,谢谢回复
要改源码 class OnNotification { final String? title; final String? summary; final String? extras;
OnNotification(this.title, this.summary, this.extras); }
} else if ("onNotification" == methodCall.method) { _onNotificationController.add(OnNotification( methodCall.arguments["title"], methodCall.arguments["summary"], ### methodCall.arguments["extras"].toString(), ));
可以提个PR吗