Firebase IOS push notification doesn't work when app is closed

后端 未结 3 1735
长情又很酷
长情又很酷 2021-01-18 05:54

Firebase IOS push notification doest not work when app is closed. I have followed all the steps as in documentation

相关标签:
3条回答
  • 2021-01-18 06:02

    Please try with this, hope it works:

    POST https://gcm-http.googleapis.com/gcm/send
    {
        "to": "TOKEN_ID",
        "priority": "high",
        "notification": {
            "title": "foo",
            "body": "bar"
        }
    }
    
    0 讨论(0)
  • 2021-01-18 06:13

    It's a quick fix, simply add "priority": "high" in your payload next to "notification" etc. and the iOS Notification will work when the app is in the background.

    So this will work:

    "to":"TOKEN ID",
    "notification" : {
      "body" : "test"
    },
    "priority": "high"
    }
    
    0 讨论(0)
  • 2021-01-18 06:22

    What worked for me was simply adding title to the notification like this:

    "notification" : {
      "title": "foo",
      "body" : "bar"
    }
    
    0 讨论(0)
提交回复
热议问题