Flutterfire: [firebase_messaging] iOS, notifications not showing on system tray

Created on 15 Apr 2020  Â·  14Comments  Â·  Source: FirebaseExtended/flutterfire

The issue is with my iOS version of the flutter app, it receives the data and i can display the onMessage and onBackground notifications on the app, but the notification does not show up on the system tray.
I know its strange since I cannot find anyone else with this problem.
I have a 100% working android app that can receive both server and test notifications, no issues with onBackground or onMessage or displaying the notification on the android system tray.

Ive double checked i followed all steps regarding iOS from the dev guide
on Info.plist file i've tried setting the _FirebaseAppDelegateProxyEnabled_ to both bool and string to NO
and also added _FirebaseScreenReportingEnabled_ to YES

i've both added and removed UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate from the AppDelegate.swift file

ive added pod 'Firebase/Messaging' to the podFile

i have all the apple certificates in place and the googleServvice-info.plist is in place.

i have set the notifications permisions request from the app and accept them every time i install it.

i mean, its all running correctly up to the point i have no issues receiving data from notifications on the app itself, its just that the system tray is not showing them upon reception.

Aditional info:

  • Iphone 8, Version 13.3.1
    `
    [✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale en-ES)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.42.1)
[✓] Connected device (2 available)
`

Please help, im no pro and even less with iPhone development there must be something im missing.

Edit:
Also, when i try the firebase console to send test notifications it will not show them on my iPhone either.

customer-response messaging bug

Most helpful comment

I have the same problem. Notification is received only when the app is active. Update to 13.4.1 didn't help.

All 14 comments

Hi @Martin-Alvarado-Void
Which iOS devices you facing this issue on?
can you please provide your flutter doctor -v and flutter run --verbose?
Also, to better address the issue, would be helpful if you could post a minimal code sample to reproduce the problem
Thank you

Give me a day, i might have missed a few warnings showing up on the xCode builder, it wont build from xCode directly, something about
/Library/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.13/ios/Classes/FLTFirebaseMessagingPlugin.m:196:43: 'FIRMessagingRemoteMessage' is deprecated: FCM direct channel is deprecated, please use APNs for downstream message handling.

I'm facing the similar situation. it only showing in onMessage,notification is not coming in background...please help if find any solution

I'm facing the similar situation. it only showing in onMessage,notification is not coming in background...please help if find any solution

meaning you receive the data when you open your app but you have no notification message on your phone?

ok, i went restarted the steps for the firebase integration, also fixed issues with my plugins (flutter_downloader and permission_handler),
i verified that i have notification permissions and capabilities. so far i have no xcode problems if i dont disable the method swizzling, when i follow the steps it throws a warning

Conditional cast from 'AppDelegate' to 'UNUserNotificationCenterDelegate' always succeeds

i still receive the notifications and can extract its data BUT no notification shows up on my tray, not even through the firebase console.

platform IOS

Flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale en-ES)
• Flutter version 1.12.13+hotfix.9 at /Library/Development/flutter
• Framework revision f139b11009 (2 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/imacdev/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.42.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1

[✓] Connected device (2 available)
• SM G975F • RF8M82ZD5NW • android-arm64 • Android 10 (API 29)
• iPhone8 • fec62c408bf0b17929a79e13aab6f635933de7ac • ios • iOS 13.3.1

• No issues found!

flutter run file:
flutter run --verbose.txt

As for the code i don't think i can give only a small part (between objects, classes, provider dependencies and more), and seeing as how i receive the data with no issues and no errors show up at all i wouldn't know what to give you, its only the notification tray that shows no message.

I can say though that the part about handling FCM notifications is the same as the examples from here.

Same problem here. Sending notification only trigger onMessage, even if the app was in background. And notification doesn't appear in on system tray.

I've found this error on app launch: Error in application:didFailToRegisterForRemoteNotificationsWithError: remote notifications are not supported in the simulator (I run the app in Simulator). It can be the cause ?

Same problem here. Sending notification only trigger onMessage, even if the app was in background. And notification doesn't appear in on system tray.

I've found this error on app launch: Error in application:didFailToRegisterForRemoteNotificationsWithError: remote notifications are not supported in the simulator (I run the app in Simulator). It can be the cause ?

Yes, if you read the firebase documentation it states that the notifications are not supported on simulators only on physical devices. if you were to pass your code over to an iPhone it should work.

Update:
i created a separate basic sample app as demonstrated by the Firebase documentation and the issue persist, i created a new apple identifier and APN key, manually set a new provisioning profile and its the same, no notification shows up but the data does.

Success!
I updated to OS 13.4.1
since it did nothing i then for the firebase sample app i went to settings and made sure that the notifications showed on blocked screen, notifications center and band.
after another console try i managed to receive a notification message on tray!

I guess that did it, i updated from 13.3.1 to 13.4.1 and now i receive notifications as i should on my original app, maybe this is a more common issue? if anyone else has OS 13.3.1 and has this issue then a little update on the documentation should be enough for the next person that is battling with this.
Thanks and Goodbye.

I have 13.4. May I should Update

I have the same problem. Notification is received only when the app is active. Update to 13.4.1 didn't help.

same issue here, anyone who manage to solve this?

Was this page helpful?
0 / 5 - 0 ratings