actingweb_firstapp icon indicating copy to clipboard operation
actingweb_firstapp copied to clipboard

Support direct reaction for background messages

Open gregertw opened this issue 3 years ago • 1 comments

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 avatar Mar 07 '21 08:03 gregertw

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

gregertw avatar Jul 20 '22 09:07 gregertw