Closed deepak786 closed 3 years ago
facing the same issue
Can you provide a link to a repository containing a complete minimal app that can reproduce the issue but don't include the firebase configuration file?
Here is the sample https://github.com/deepak786/flutter_notifications_issue
It seems that the sample is working fine. In our app, we have the same code but their notifications are not working.
Is that due to some other dependency conflict? Here is the pubspec.yml file from the main app.
_Note: Notifications are working fine in our main app without this flutter_local_notifications
package._
Added the property IntercomAutoIntegratePushNotifications
with a value of NO
in Info.plist
and then foreground notifications are working fine in our main app as we also used the dependency intercom_flutter
.
Now we have the following issues with iOS:
The above issues are reproducible in the sample code https://github.com/deepak786/flutter_notifications_issue
Sounds like you are having issues with more dependencies than you've originally mentioned. I suggest you try removing said dependencies to narrow down the cause as you potentially need to log that issue with whoever maintains the package. For example, have you tried remove the intercom_flutter
package? Based on what you've written, it's interfering with the receiving of messages from FCM, in which case, that's not an issue with this plugin. Note I'm not able to look at issues involving other dependencies besides firebase_messaging
. It may be possible that if you need integrate FCM, local notifications and intercom that you need to write all of the iOS code yourself or look to see what changes can be made to this plugin so that they all work together via a PR
@MaikuB as I already said the only issue is that onBackgroundHandler is not getting called. The issue is reproducible in sample. In the sample, I'm not using any dependencies that can conflict.
Got it. Had some confusion as you originally wrote the sample worked fine but not the main app so thought you went to add the intercom dependency to the sample to illustrate it though I hadn't gotten the chance to look at it yet
try fcm_config
@deepak786 the example app you've provided fails with the following error
error: The file "/Users/michaelbui/Projects/GitHub/flutter_notifications_issue/ios/ImageNotification/ImageNotification.entitlements" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "ImageNotification" is correct and that the file exists on disk. (in target 'ImageNotification' from project 'Runner')
In the mean time, I tried reproducing the issue you've reported with an example I've had for a while and updated recently and don't see the issue. It can be found https://github.com/MaikuB/flutter_firebase_local_notifications_examples/tree/master/kotlin_swift. Steps I've followed are to run the app in release mode, put it in the background and send a notification from the server and making sure the payload has content_available
set to true. This is a requirement for background notifications to caught. Wondering if you've missed this as when there are compatibility issues between these plugins, it would impact both foreground and background scenarios
I have tried already with content_available
to true in the payload.
It seems that the issue is in the firebase_messaging plugin. check https://github.com/FirebaseExtended/flutterfire/issues/6290
Closing this then as it's not an issue with this plugin
@MaikuB don't you think flutter_local_notifications was fighting with firebase-messaging for UNNotificationCenter delegation control ?
No as the original issue that was reported had nothing to do with this plugin even (i.e. the background messaging issue would occur even there wasn't a dependency on this plugin) and as mentioned earlier, I was able to get notifications running from both. The FCM example app actually includes this plugin as a dependency so if there were conflicts, the maintainers of the FCM plugin would've identified that as well
Not able to use both packages in the same app in iOS. Checked all the other threads and related issue. There is no proper solution to make them work together on iOS.
Using the below package versions in the app.
firebase_messaging: 10.0.2
is used then all the background and foreground messages and their logs are working fine on both Android and iOS.firebase_messaging: 10.0.2
andflutter_local_notifications: 6.0.0
then everything is working fine on Android. But on iOS: