Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chenka321 opened this issue Mar 8, 2024 · 1 comment

Comments

@chenka321
Copy link

在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
Copy link
Member

我现在精力有限,欢迎PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants