首页 > 解决方案 > Data Payload is not working in ios using FCM push notification

问题描述

I'm sending a notification using FCM server. My notification is working good when i'm sending from FCM console and postman.

In postman "notification payload" is working "data payload" is not working.and im shaing my payloads below,

notification payload.

{
    "to":"asdF1X0mzp6SwjF......",
    "priority":"high",
    "content-available":true,
    "ios":{
        "priority":"high"
    },
    "apns":{
        "headers":{
            "apns-priority":"5"
        },
        "payload":{
            "aps":{
                "content-available":true
            }
        }
    },
    "data":{
        "duration":"00:00:00",
        "time":"15-Feb-2021 13:33:00",
        "title":"On",
        "body":"15-Feb-2021 13:33:00"
    },
    "notification":{
        "title":"On",
        "body":"15-Feb-2021 13:33:00"
    }
}

Data payload

{
    "to":"asdF1X0mzp6SwjF......",
    "priority":"high",
    "content-available":true,
    "ios":{
        "priority":"high"
    },
    "apns":{
        "headers":{
            "apns-priority":"5"
        },
        "payload":{
            "aps":{
                "content-available":true
            }
        }
    },
    "data":{
        "duration":"00:00:00",
        "time":"15-Feb-2021 13:33:00",
        "title":"On",
        "body":"15-Feb-2021 13:33:00"
    }
}

I tried different payloads that not helped me. As per the FCM Document i used to sent Legacy HTTP V1 & Oauth2.0 also not working. My Push notification certificate and others are configured good. Kindly share your thoughts and correct me i'm sending a correct one or not.Thanks in advance

标签: iosiphonefirebasefirebase-cloud-messagingpayload

解决方案


推荐阅读