firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.63k stars 3.95k forks source link

🐛 [firebase_messaging] After phone lock screen 5 minutes later, BackgroundMessage sometimes can't receive #11018

Closed niumj closed 6 months ago

niumj commented 1 year ago

Bug report

After phone lock screen 5 minutes later, BackgroundMessage sometimes can't receive device:Pixel3,Xiaomi9 When charging,send 20 notifications from the server , all notifications can be received. When uncharged state and after phone lock screen 5 minutes later, send 20 notifications from the server which sent by firebase-admin, BackgroundMessage can't receive. But can receive the message which is directly sent through the firebase console. What's the difference? And how can I set on my server when send the notification by irebase-admin?

firebase_messaging: ^14.2.2

https://github.com/firebase/flutterfire/issues/10419 https://github.com/firebase/flutterfire/discussions/10991

Sample code

AndroidNotification.Builder androidNotifiBuilder=AndroidNotification.builder(); ... androidNotifiBuilder.setPriority(Priority.HIGH); ... AndroidNotification androidNotification=androidNotifiBuilder.build(); androidConfigBuilder.setNotification(androidNotification);

darshankawar commented 1 year ago

@niumj See if it this helps in your case or not. https://github.com/firebase/flutterfire/issues/8485#issuecomment-1262420846

niumj commented 1 year ago

It is not my case. Because can receive the message which is directly sent through the firebase console. So how can I make the same result which is sent by firebase-admin ?

google-oss-bot commented 1 year ago

Hey @niumj. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@niumj if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

darshankawar commented 1 year ago

It seems bot didn't remove waiting label and hence this issue got closed. Reopening.

russellwheatley commented 6 months ago

The system can restrict the messages that get through to the device, which depend on a number of factors including battery life. This is why they are sometimes blocked when the device is not charging. FlutterFire has no control over this.