当应用程序在 ios 后台时不显示本机推送通知

时间:2021-03-24 17:25:20

标签: ios react-native react-native-firebase

到目前为止,我一直使用 react-native-firebase 版本 5.5.6 (https://www.npmjs.com/package/react-native-firebase/v/5.5.6) 来响应本机应用程序来接收推送通知,并且在 android 和 ios 中都可以正常工作。 现在我升级到 react-native-firebase 版本 11.1.2 和 react-native-firebase/messaging 版本 11.1.2。 在 android 中,通知在所有应用程序状态下都能正常工作(前台、后台、关闭) 在 ios 中,当应用程序在前台时,通知可以正常接收,但在后台或关闭的应用程序中,通知未显示 我在 xcode 的后台模式中标记远程通知并获取通知 当在前台并且我收到通知时,这是我收到的 json

{
aps =     {
    alert =         {
        body = "\nCat. No.: 34612\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\nFloor: 2\nReported about: Intercoms    \nStatus: Your call has been received\n Description: check\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7";
        title = "New message about a service call";
    };
    badge = 2;
    "content-available" = 1;
    "mutable-content" = 1;
};
"custom_notification" = "{\"title\":\"New message about a service call\",\"body\":\"\\nCat. No.: 34612\\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\\nFloor: 2\\nReported about: Intercoms    \\nStatus: Your call has been received\\n Description: check\\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7\",\"show_in_foreground\":true,\"icon\":\"push_notification\",\"sound\":\"default\"}";
deepLink = "https://darimpo-test.appspot.com/#openApplication?serviceCallId=34612&taskPostId=151288";
"fcm_options" =     {
    image = "https://storage.googleapis.com/download/storage/v1/b/darimpo_test_images/o/8551.jpg?generation=1615666155330439&alt=media";
};
"gcm.message_id" = 1616606515037965;
"google.c.a.e" = 1;
"show_in_foreground" = "{\"title\":\"New message about a service call\",\"body\":\"\\nCat. No.: 34612\\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\\nFloor: 2\\nReported about: Intercoms    \\nStatus: Your call has been received\\n Description: check\\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7\",\"show_in_foreground\":true,\"icon\":\"push_notification\",\"sound\":\"default\"}";

}

也许你现在为什么不为我工作 谢谢

0 个答案:

没有答案