Skip to content

Flutter : FirebaseMessaging "onBackgroundMessage" with FFmpegKit #209

Closed
@ujwalparker

Description

@ujwalparker

Description
In an app (Flutter) where we have configured FirebaseMessaging (https://pub.dev/packages/firebase_messaging/) with the onBackgroundMessage handler the FFmpegKit plugin is not usable as there seems to be some conflict due to which the EventChannel which is created by this plugin is rendered null

Expected behavior
Methods like FFmpegKit.executeAsync or FFprobeKit.getMediaInformationAsync or others execute with a result.

Current behavior
The methods FFmpegKit.executeAsync or FFprobeKit.getMediaInformationAsync or others fail with the following sample error

W/ffmpeg-kit-flutter(32468): ResultHandler can not send event {FFmpegKitExecuteCallbackEvent={createTime=1635353254392, startTime=1635353254414, sessionId=1, type=1, command= -i /data/user/0/com.arre.voice/app_flutter/effects/drumroll.wav -i /data/user/0/com.arre.voice/app_flutter/effects/cheer.wav -i /data/user/0/com.arre.voice/app_flutter/effects/boo.wav -filter_complex amix=inputs=3:duration=longest -y /storage/emulated/0/Android/data/com.arre.voice/files/[#6d178].m4a}} on a null event sink.

To Reproduce
Just add FirebaseMessaging to the app and implement onBackgroundMessage handler.

Screenshots
image

Logs
successAsync gets called for any method but eventSink is render null thus the error message printed by the plugin
Log.w(LIBRARY_NAME, String.format("ResultHandler can not send event %s on a null event sink.", object));

Environment

  • Platform: Flutter Android
  • Architecture: arm64, and others too
  • Version v4.5.0
  • Source branch v4.5.0

Other
FirebaseMessaging has 3 handlers as below ( firebase_messaging: ^10.0.7)

  • FirebaseMessaging.onMessage
  • FirebaseMessaging.onMessageOpenedApp
  • FirebaseMessaging.onBackgroundMessage

When you just do not set the "FirebaseMessaging.onBackgroundMessage" handler the plugin works fine.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions