flutter-android-background icon indicating copy to clipboard operation
flutter-android-background copied to clipboard

Not listen notification when i use notifications: ^2.0.1

Open UbaidBodla opened this issue 3 years ago • 1 comments

Give an error when i use **notifications: ^2.0.1 ** with it

the exception is

MissingPluginException(No implementation found for method listen on channel notifications)

But in others app when in use notifications: ^2.0.1 this listen the notification. @ppicas can you please tell me why this is happening.

UbaidBodla avatar Jan 07 '22 14:01 UbaidBodla

Hi Ubaid, probably this is because the new Dart instance running in the BackgroundService don't have the MethodChannel registered that is used by notifications package.

You will have to find a way to register the plugins also in the background Dart instance. For instace calling AppPluginRegistrant.registerWith() method when the new instance is created at BackgroundService.

(Sorry but I can't provide the code because I don't have time for it)

ppicas avatar Jan 10 '22 11:01 ppicas