You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I've got both display and data messages working beautifully on Android, and just data messages on iOS. The problem is with display messages (notifications) on iOS. The problem also seems straightforward though I've not found any other issues or documentation referencing anything quite like it.
When I send a notification (with notification payload) to my iOS client (written with Flutter), no notification shows up in the system tray while the app is closed. Instead, upon opening the app, the onMessage message handler is called. This is in direction contradiction of the docs, which state unambiguously that onMessage will never be called for notifications while the app is in the background.
I can't think of anything I've done out of the ordinary. No method swizzling. What's going on?
Steps to reproduce
Steps to reproduce the behavior:
Code as below
Grab Firebase registration token from the debug version running on a real iOS phone
Send app to background
Send test notification through Firebase console
... nothing happens until I open the app, at which point the wrong message handler is called
Instead of onMessage being called upon opening the app, the notification should have been delivered to the system tray while the app was in the background.
Additional context
The phone is running iOS 13.5.1. All notification settings are enabled for the app. Run through flutter run in the Android Studio.
Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G73, locale en-GB)
• Flutter version 1.20.2 at /Users/lessgo/lessgo/flutter
• Framework revision bbfbf1770c (3 weeks ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/lessgo/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
✗ Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.1
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2
[✓] Connected device (1 available)
• Ruben’s iPhone (mobile) • 00008030-00012062022B802E • ios • iOS 13.5.1```
</details>
---
### Flutter dependencies
Run `flutter pub deps -- --style=compact` and paste the output below:
<details><summary>Click To Expand</summary>
Maybe someone else can learn from my mistakes. This was an "entitlement" problem in XCode. I had already ticked "Remote notifications" etc. Not enough. You also need to click "Capability +" in the top-left corner and add Push Notifications. If you use Schemes -- still not enough. You might want to set it up separately for each scheme, because adding the capability adds an aps-environment variable in some file somewhere which is first set to development. I just let XCode make all the files then took it from there with a text editor to set the relevant files to production, which XCode wouldn't do even with an "App Store" (production/distribution) provisioning profile selected.
Bug report
First off, I've got both display and data messages working beautifully on Android, and just data messages on iOS. The problem is with display messages (notifications) on iOS. The problem also seems straightforward though I've not found any other issues or documentation referencing anything quite like it.
When I send a notification (with notification payload) to my iOS client (written with Flutter), no notification shows up in the system tray while the app is closed. Instead, upon opening the app, the onMessage message handler is called. This is in direction contradiction of the docs, which state unambiguously that onMessage will never be called for notifications while the app is in the background.
I can't think of anything I've done out of the ordinary. No method swizzling. What's going on?
Steps to reproduce
Steps to reproduce the behavior:
firebase_notifications.dart
AppDelegate.swift
Expected behavior
Instead of
onMessage
being called upon opening the app, the notification should have been delivered to the system tray while the app was in the background.Additional context
The phone is running iOS 13.5.1. All notification settings are enabled for the app. Run through
flutter run
in the Android Studio.Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Dart SDK 2.9.1
Flutter SDK 1.20.2
dependencies:
dev dependencies:
transitive dependencies:
The text was updated successfully, but these errors were encountered: