twilio_voice
twilio_voice copied to clipboard
[Question][Android] How to use another plugin that handles FCM notifications (awesome_notifications or firebase_messaging with flutter_local_notifications)
Issue Summary
I have integrated the plugin in my app and everything is working as expected. But if I try to send a custom FCM notification to the app, that notification is captured by the plugin and doesn't reach Awesome_notifications plugin. This is mainly to do with this code.
<service
android:name="com.twilio.twilio_voice.fcm.VoiceFirebaseMessagingService"
android:exported="false"
android:stopWithTask="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Steps to Reproduce
- Use the plugin in any application.
- Add the notification handling plugin. In my case awesome_notifications and awesome_notifications_fcm plugin
- Send a non-twilio FCM notification using admin_sdk
- Log prints
D/VoiceFirebaseMessagingService(11750): onMessageReceived: The message was not a valid Twilio Voice SDK payload, continuing...
- Awesome_notifications is not triggered
Is there any known method to overcome this limitation?
The workaround that I can think of would be to create another methodChannel that will receive the entire FCM payload and manually trigger the VoiceFirebaseMessagingService.
Hi @katphlab
Thank you for bringing this to my attention - I'll investigate and report back.
I have created a fix for this by implementing the showBackgroundCallUI function and using the twilio payload to call the Twilio SDK. #212