Ionic-使用Firebase FCM API的iOS推送通知不起作用

时间:2018-08-16 06:33:03

标签: ios firebase ionic-framework ionic3 firebase-cloud-messaging

  

我正在使用发布方法发送推送通知,并且   https://fcm.googleapis.com/fcm/send从android和ios设备导入   离子3

当我使用邮递员原始数据时,就会被推送

  

原始数据发布的邮递员代码

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Authorization: key=AIzaSyCQaREF6-fNaDK5tnya5ANP_QFagcvTiTI
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: f399607f-fe79-dfcc-1f4f-130a8c261986

{
    "data":{
        "title":"IIML Alumni",
        "message":"You have recived new message from Osama Ejaz ",
        "soundname":"default",
        "style":"chat",
        "summaryText":"You have recived new message from Osama Ejaz ",
        "vibrationPattern":[2000],
        "msg":"You have recived new message from Osama Ejaz",
        "type":"inbox",
        "body":"You have recived new message from Osama Ejaz ",
        "notId":"838",
        "badge":1,
        "visibility":1,
        "color":"#26acce",
        "content_available":true,
        "priority":"high",
        "sound":"default"
    },
    "notification":{
        "title":"IIML Alumni",
        "message":"You have recived new message from Osama Ejaz ",
        "soundname":"default",
        "style":"chat",
        "summaryText":"You have recived new message from Osama Ejaz ",
        "vibrationPattern":[2000],
        "msg":"You have recived new message from Osama Ejaz",
        "type":"inbox",
        "body":"You have recived new message from Osama Ejaz ",
        "notId":"838",
        "badge":1,
        "visibility":1,
        "color":"#26acce",
        "content_available":true,
        "priority":"high",
        "sound":"default"
    },
    "to":"efX3lmwceyE:APA91bETEx9hqhf88G-HhKn-cyYxizWR_BZhvo_iimUbr_4UFm6ksbTlDVc-Iz0VImawsO7newrlwtQJrJ3iunNq-qzV34JQSheKxcuMwFVu5PhLRtHWAFOc2-bNVZteayUeHbPUp3L8eLlXOSQ7dj9q2ao1mo0-LQ"
}

但是当我使用邮递员使用表单数据时,我得到了成功ID,但没有收到推送通知到iOS设备。

  

用于表单数据发布的邮递员代码

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Authorization: key=AIzaSyCQaREF6-fNaDK5tnya5ANP_QFagcvTiTI
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
Postman-Token: 9209e3e9-fb4b-777b-fcae-a35cc32686ef

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="data"

{title:"IIML Alumni",message:"You have recived new message from Osama Ejaz" ,soundname:"default",style:"chat",summaryText:"You have recived new message from Osama Ejaz" ,vibrationPattern:[2000],msg:"You have recived new message from Osama Ejaz",type:"inbox",body:"You have recived new message from Osama Ejaz",notId:"838",badge:"1",visibility:"1",color:"#26acce",content_available:"true",priority:"high",sound:"default"}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="notification"

{title:"IIML Alumni",message:"You have recived new message from Osama Ejaz" ,soundname:"default",style:"chat",summaryText:"You have recived new message from Osama Ejaz" ,vibrationPattern:[2000],msg:"You have recived new message from Osama Ejaz",type:"inbox",body:"You have recived new message from Osama Ejaz" ,notId:"838",badge:"1",visibility:"1",color:"#26acce",content_available:"true",priority:"high",sound:"default"}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="to"

efX3lmwceyE:APA91bETEx9hqhf88G-HhKn-cyYxizWR_BZhvo_iimUbr_4UFm6ksbTlDVc-Iz0VImawsO7newrlwtQJrJ3iunNq-qzV34JQSheKxcuMwFVu5PhLRtHWAFOc2-bNVZteayUeHbPUp3L8eLlXOSQ7dj9q2ao1mo0-LQ
------WebKitFormBoundary7MA4YWxkTrZu0gW--
  

如何使用IONIC NATIVE HTTP插件发布原始数据?   还有其他方法可以将推送发送到iOS设备吗?

0 个答案:

没有答案