Skip to content

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

@chenka321

Description

@chenka321

在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);
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions