capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat(push-notifications): Send an Android broadcast with the remoteMessage inside the firebase onMessageReceived event

Open NePheus opened this issue 2 years ago • 0 comments

Content of this PR This pull request is intended to send a broadcast message in android, after an incoming firebase push notification.

Why Unfortunately it is not possible to register more than one FirebaseMessagingService in the same app (see here). With help of the BroadcastReceiver, another plugin can hook in here and also listen to the remote messages with a broadcast listener: registerReceiver(MyBroadcastReceiver, new IntentFilter("android.intent.action.capacitor.pushnotification"));

Example use case https://github.com/NePheus/capacitor-fullscreen-notification Send a (silent) data notification to the app to show a local notification with a fullscreen intent (i.e. call action). An event must be triggered by the push-notifications plugin to notify about the data notification.

NePheus avatar Aug 13 '22 14:08 NePheus