Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support direct reaction for background messages #22

Open
gregertw opened this issue Mar 7, 2021 · 1 comment
Open

Support direct reaction for background messages #22

gregertw opened this issue Mar 7, 2021 · 1 comment

Comments

@gregertw
Copy link
Owner

gregertw commented Mar 7, 2021

Both iOS and Android support direct app reaction from push notifications (i.e. not go via the system notification system and wait for the user to tap the message). This was quite tricky in earlier versions of firebase_messaging, however, the plugin has been reworked and should now support such background reaction directly. This needs to be tested and verified though, and custom logic is needed for this type of push notifications.

From README:
This app can receive notifications while in the background or terminated through the onResume() and onLaunch() events. You should only use so-called "notification" messages and not "data" messages for this (though you can have extra key/value pairs in the "data" section). For both Android and iOS, the notification will appear in the system tray and the app is launched and onResume() or onLaunch() triggered. It is also possible to make app react directly from the background to notifications. However, this requires custom logic for Android and iOS and is not straightforward, so be warned. There was also a bug related to background handling: https://github.com/FirebaseExtended/flutterfire/issues/1763 This is now fixed, but I have not prioritised trying to make it work.

@gregertw
Copy link
Owner Author

Latest firebase_messaging states that swizzling cannot be turned off. Might be relevant so just adding a reminder here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant