简体   繁体   中英

Firebase Notification Flutter iOS

I have developed a flutter application and integrated Firebase notification and firebase phone authentication.

I am able to do phone authentication both on development mode as well as after the app is published

I am able to receive notification when the app is development mode - but when I publish the app I dont receive the notification.

I should point out here that I am able to receive the notification if I send it from the firebase console (even after the app is published) - but I do not receive notification from my panel after the app is published (but the same is working absolutely fine otherwise)

I should also point out that this problem is only faced with iOS and not android.

What am I missing?

When you are sending notification to mobile phone using firebase push notification service then make sure the payload is set correctly in order to successfully deliver the notification to mobile phone.

The basic example of the payload for FCM is as follows.

{
  "to": "<FCM TOKEN OF DEVICE>",
  "data": {
    "key1": "value1",
     "key2": "value2"
  },
  "priority": "high",
  "notification": {
   "body": "This is body",
    "title": "This is title",
    "sound": "default"
  },
  "message": {
    "notification": {
      "title": "This is title",
      "body": "This is body"
    }
  }
}

You can go through this article to know more about FCM service and its payload.

EDIT

Also you need to make sure that the correct certificate is uploaded on the firebase console.

You can export those certificate from the keychain.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM