OpenFlutter / rammus

Flutter Plugin for AliCloud Push.阿里云推送插件
Apache License 2.0
77 stars 40 forks source link

2.5.1版本会出现 推送消息能收到,推送通知无法收到的问题 #57

Open chenka321 opened 7 months ago

chenka321 commented 7 months ago

在2.5.1版本中 rammus-2.5.1\lib\src\cloud_push_message.dart文件中

class OnNotification {
  final String? title;
  final String? summary;
  final String? extras;
  OnNotification(this.title, this.summary, this.extras);
}

extras类型为String 而在 RammusPushIntentService 中

override fun onNotification(context: Context, title: String?, summary: String?, extras: MutableMap<String, String>?) {
        Log.d("RammusPushIntentService","onNotification title is $title, summary is $summary, extras: $extras")
        handler.postDelayed({

            RammusPushHandler.methodChannel?.invokeMethod("onNotification", mapOf(
                    "title" to title,
                    "summary" to summary,
                    "extras" to extras
            ))
        },1500)
    }

extras是Map这样会报错的 有两种办法, 第一种是使用rammus-2.5.0 版本 另一种是需要改为

class OnNotification {
  final String? title;
  final String? summary;
  final Map? extras;//这里类型由String改为Map
  OnNotification(this.title, this.summary, this.extras);
}

希望作者可以尽早修复这个小问题

JarvanMo commented 7 months ago

我现在精力有限,欢迎PR