Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[firebase_messaging]: FirebaseMessaging.onMessage not received any data

Aperta
#18,776 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
dart, firebase, flutter

Direzione di ricerca

Start by checking the firebase_messaging iOS implementation around FLTFirebaseMessagingPlugin.configureNotificationCenterDelegate() and how foreground messages reach FirebaseMessaging.onMessage. Reproduce the report on an iOS simulator using the provided notification and data payload, then compare behavior with the banner presentation options. Done means identifying why the foreground callback receives no data and confirming the expected behavior with a focused regression test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

blocked: customer-response Needs Attention platform: ios plugin: messaging type: bug
Is there an existing issue for this?
  • I have searched the existing issues.
Are you aware of the differences between iOS and Android background message handling?
  • I understand that iOS and Android background messages behave differently, and I've designed my application with that in mind.
Do you have an active Apple Developer account?
  • I have an active Apple Developer account.
Are you using a physical iOS device to test background messages?
  • I am using a physical iOS device to test background messages.
Have you enabled "Remote Notifications" & "Background Mode" (Checking options for "Background Processing" & "Remote Notifications") in your app's Xcode project?

iOS simulator issues
FirebaseMessaging.onMessage not working

version firebase_messaging: ^16.7.0
added FLTFirebaseMessagingPlugin.configureNotificationCenterDelegate()

Have you created an APNs key in your Apple Developer account & uploaded this APNs key to your Firebase console?

yes

Have you disabled method swizzling for Firebase in your app?
<array>
	<string>UIInterfaceOrientationPortrait</string>
	<string>UIInterfaceOrientationPortraitUpsideDown</string>
	<string>UIInterfaceOrientationLandscapeLeft</string>
	<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>FirebaseAppDelegateProxyEnabled</key>
<true/>
Are you sending messages to your app from the Firebase Admin SDK?

{
message: {
token: token,
notification: {
title: notifTitle,
body: notifBody,
},
data: {
title: notifTitle,
body: notifBody,
thread_id: String(thread_id || ""),
type: String(type || "CHAT"),
//...data,
},
android: {
priority: "HIGH",
notification: {
title: notifTitle,
body: notifBody,
sound: "default",
channel_id: "bizcentre_omnichannel_channel",
notification_priority: "PRIORITY_MAX",
default_sound: true,
default_vibrate_timings: true,
visibility: "PUBLIC",
},
},
apns: {
headers: {
"apns-push-type": "alert",
"apns-priority": "10"
},
payload: {
aps: {
alert: {
title: notifTitle,
body: notifBody,
},
sound: "default",
badge: 1,
"content-available": 1,
'mutable-content': 1,
},
},
},
},
}

Have you requested permission from the user to receive notifications?
  • I have the relevant permission to receive notifications.
Have you used the 'Console' application on your macOS device to check if the iOS device's system is throttling your background messages?

the banner shown if set
await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
alert: true,
badge: true,
sound: true,
);

Additional context and comments

No response

Lingua principale
Dart
Stelle
9.3k
Fork
4.1k
Merge medio
2g 2h
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/flutterfire

Tutte le issue di firebase/flutterfire

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.