Ios 设备未收到通知时遇到问题。相同的设置在 Android 上运行良好

Facing an issue with Ios Notification which is not receiving at device. Same setup is working fine with Android

使用 fcm 推送通知 ios 和 Android

要求:

fcm = FCM.new(ENV["FCM_TOKEN"])
options = {data: {message: message}, priority:'high'}
response = fcm.send(device_tokens, options)

响应:

{:body=>
"{"multicast_id":8122297942819980145,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1505802064679190%9310a6bdf9fd7ecd"}]}",
:headers=>
{"content-type"=>["application/json; charset=UTF-8"],
"date"=>["Tue, 19 Sep 2017 06:21:04 GMT"],
"expires"=>["Tue, 19 Sep 2017 06:21:04 GMT"],
"cache-control"=>["private, max-age=0"],
"x-content-type-options"=>["nosniff"],
"x-frame-options"=>["SAMEORIGIN"],
"x-xss-protection"=>["1; mode=block"],
"server"=>["GSE"],
"alt-svc"=>["quic=":443"; ma=2592000; v="39,38,37,35""],
"accept-ranges"=>["none"],
"vary"=>["Accept-Encoding"],
"connection"=>["close"]},
:status_code=>200,
:response=>"success",
:canonical_ids=>[],
:not_registered_ids=>[]}

发现讨论很少,但没有帮助

issues/15

issues/1

passing the options: 'priority': 'high' might solve the issue. But doesn't work for me.

面临 Ios 设备未收到通知的问题。 相同的设置在 Android 上运行良好。

如果我在这里做错了什么,请告诉我。

最初我遇到了同样的问题,但在寻找解决方案后,我发现了这条评论 https://github.com/spacialdb/fcm/issues/1#issuecomment-223152688

负载应该有一个带有标题和 body 属性的通知 object,

options = { notification: {title: "Some Title", body: "Some description"}, data: {extra_data: {}}, priority: 'high' } 像上面那样修改选项负载对我有效。

我也回答了你的问题here