默认
发表评论 0
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
集成 Firebase 后,SDK 回调不触发
阅读(5933) | 评论(0 收藏 淘帖

找到 packages/firebase_messaging/firebase_messaging/android/src/main/java/io/flutter/plugins/firebase/messaging/FlutterFirebaseMessagingBackgroundExecutor.java 类

修改代码如下:(来源参考:https://www.rongcloud.cn/?#seo

```
if (shellArgs != null) {

Log.i(

TAG,

""Creating background FlutterEngine instance, with args: ""

+ Arrays.toString(shellArgs.toArray()));

   // 1. 修改此处如下

   // backgroundFlutterEngine =

   //     new FlutterEngine(

   //         ContextHolder.getApplicationContext(), shellArgs.toArray());

backgroundFlutterEngine =

new FlutterEngine(

ContextHolder.getApplicationContext(), shellArgs.toArray(), false);



} else {

Log.i(TAG, ""Creating background FlutterEngine instance."");

   // 2. 修改此处如下

   // backgroundFlutterEngine =

   //     new FlutterEngine(ContextHolder.getApplicationContext());

backgroundFlutterEngine =

new FlutterEngine(ContextHolder.getApplicationContext(), null, false);

}

```

即时通讯网 - 即时通讯开发者社区! 来源: - 即时通讯开发者社区!

上一篇:语音消息使用 remote 地址在 android 手机上播放失败下一篇:5.x版本依赖构建失败,提示Emoji报错
推荐方案
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部