我正在使用具有MongooseIM-Push功能的MongooseIM。我已经在Android和IOS上都配置了FCM,并且两者都工作正常(通过从节点js代码发送通知推送进行测试)。
在使用MongooseimPush(正在运行的docker映像)时,尽管我仍然能够在android上接收推送,但对于每个发送的节,我仍收到以下错误
11:46:00.372 [error] Unable to submit push notification. ErrorCode 460, Payload <<"{\"topic\":null,\"service\":\"fcm\",\"mode\":\"prod\",\"data\":{\"message-count\":1,\"last-message-sender\":\"a9jpmqz7sil9qdbr@localhost\",\"last-message-body\":\"{\\\"text\\\":\\\"nh\\\"}\"}}">>.Possible API mismatch - tried URL: <<"v2/notification/fdOXsUNXwHc:APA91bG2oIdmhrRZ5L3w2RCPE17sn9fur74LGYGnqHWl5p5o3Xr4Y-1YDhwjfhQAs4gLr7gOETsKDArL5wPuFXJGvoW2nrhr87DdAxvWpY0J4uh1ZuoZMTqn7w14vwg7kW48Lki9T8Xx">>.
11:46:00.383 [error] Unable to submit push notification. ErrorCode 460, Payload <<"{\"topic\":null,\"service\":\"fcm\",\"mode\":\"prod\",\"alert\":{\"title\":\"a9jpmqz7sil9qdbr@localhost\",\"tag\":\"a9jpmqz7sil9qdbr@localhost\",\"click_action\":null,\"body\":\"{\\\"text\\\":\\\"nh\\\"}\",\"badge\":1}}">>.Possible API mismatch - tried URL: <<"v2/notification/fdOXsUNXwHc:APA91bG2oIdmhrRZ5L3w2RCPE17sn9fur74LGYGnqHWl5p5o3Xr4Y-1YDhwjfhQAs4gLr7gOETsKDArL5wPuFXJGvoW2nrhr87DdAxvWpY0J4uh1ZuoZMTqn7w14vwg7kW48Lki9T8Xx">>.
Docker中没有错误
11:48:37.174 [debug] Sent 200 in 86ms
11:48:37.327 [debug] Sent 200 in 245ms
11:48:42.580 [debug] POST /v2/notification/dU5K-csGDQ8:APA91bH6V4ctXe_tFy8xE6jfCVLCbS4lMuEU4SlFxZqAF85Hb9I-eoZhRQCfCXSw-JenX8xJ5DYnfSDTyzdoj0JmizdRCmNnCDPecevQj3r6waoYQhRKE_xOKBNLDAQVifn7VzPDwsCX
11:48:42.582 [debug] POST /v2/notification/ffFcxJGqD7Q:APA91bHCGy6qA-i2dzjIVDxBvevo3hcCzbBXXB1JrdFclpalGwaWCdE3PAd-XtEKj9MIJxITnOA7E3l_lUkRPvQybGbGDAkH3sNBawRFekQEocxHnQxJize_BoY4I10GieYY0_4602Xd
以下是mongooseim配置文件中的配置
{mod_event_pusher, [
{backends, [
{push, [{wpool, [{workers, 100}]}]}
]}
]},
{mod_pubsub, [
{host, "pubsub.@HOST@"},
{plugins, [<<"push">>]}
]},
{mod_push_service_mongoosepush, [
{pool_name, mongoose_push_http},
{api_version, "v2"}
]}
{outgoing_pools, [
{http, global, mongoose_push_http,
[{strategy, available_worker}],
[{server, "https://localhost:8443"}]}
]}.
答案 0 :(得分:1)
响应代码 460 对应于无效的设备令牌。正如您在评论中所说,您已多次安装/卸载该应用程序。所有旧令牌可能不再有效,猫鼬会收到 460 错误。通知成功,因为至少一个(最可能是最新的)令牌有效。为了删除先前注册的令牌,您可以按照XEP-0357#disabling中的说明停用令牌。我还建议阅读tutorial,有关使用MongooseIM和MongoosePush [3]进行推送通知。
您提供的配置对我来说是正确的。