jpush_flutter 已按 github 设置,证书也已配置,还需要做什么才能有 deviceToken收到推送?

ansen
2019-05-28 05:18 2.9k 0

1.已在 main 里初始化配置

JPush jPush = JPush();
jPush.addEventHandler(
onReceiveNotification: (Map<String, dynamic> message) async {
print("flutter onReceiveNotification: $message");
},
// 点击通知回调方法。
onOpenNotification: (Map<String, dynamic> message) async {
print("flutter onOpenNotification: $message");
},
// 接收自定义消息回调方法。
onReceiveMessage: (Map<String, dynamic> message) async {
print("flutter onReceiveMessage: $message");
},
);

jPush.setup(
debug: true,
appKey: "xxxxx",
channel: "developer-default",
production: false
);

jPush.getRegistrationID().then((rid)
{print('Register id $rid');}
);
}

2.证书已设置
null

3.提示错误:
Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed? or there is no APNs register code? Please refer to JPush docs.
| JIGUANG | W - [JIGUANGDeviceTokenController] Not get deviceToken yet. After successful login, a custom message can be sent, but the APNs notification cannot. Until the deviceToken is obtained and reported successfully, the APNs notification can be used normally.

4.请问还需要配置什么,才能有 deviceToken

1个回答

热门排序
  • ansen
    2019-05-28 05:29

    push notification 开关已打开
    Bundle ID 3处都一致