|
/

离线推送时,通知渠道channel的重要性importance值会从“高”变成“一般”,这是什么原因

S沈***23
发布于 3 年前
5459来自湖北省
消息推送 U-Push
移动统计 U-App
功能使用


消息的提醒级别importance设置的是NORMAL,我指的importance是通知channel的importance值,通过下面一段代码跳转到通知页,调整通知渠道channel的重要性为“高”,值为4。

Intent intent = new Intent();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
} else {
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
intent.putExtra("app_package", context.getPackageName());
intent.putExtra("app_uid", context.getApplicationInfo().uid);
}
if (currentActivity != null) {
currentActivity.startActivity(intent);
NotificationManager notificationManager = (NotificationManager) currentActivity.getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
notificationManager.areNotificationsEnabled();
}
}

但是在下一次接收到离线通知后,通知渠道channel的重要性自动降为了“一般”,值为3。

通知内容的importance值为“NORMAL”,category为“WORK”。

这种通知渠道channel的重要性自动降级是什么原因呢?

另外,我集成的是友盟推送,使用华为推送版本为

api 'com.huawei.hms:push:6.9.0.300'
5个回答
 
3 年前
来自浙江省

你好,这个通知的类型,sdk无法控制的。

 
3 年前
来自湖北省

我指的通知渠道channel的重要性属性为以下截图所示,有4个级别。如我之前所述,此属性默认选择“一般”,但是在手动设置为“高”后,在再次收到离线通知后会自动降到“一般”。请问这种现象是什么原因导致的呢?

 
3 年前
来自浙江省

你好,你可以提供一下截图吗

Loading ...
登录社区,分享你的经验