捆绑通知不适用于牛轧糖

时间:2018-11-12 12:17:50

标签: android android-notifications

我正在尝试为可能的通知创建捆绑包。但是问题是,通知显示为孤立但未捆绑,我已经搜索了文档但没有任何线索。

NotificationManager notificationManager = (NotificationManager)ctx.getSystemService(Context.NOTIFICATION_SERVICE);

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
    NotificationChannel channel = new NotificationChannel("default",
            "com.technologics.developer.motorcityarabia.name",
            NotificationManager.IMPORTANCE_DEFAULT);
    channel.setDescription("Ycom.technologics.developer.motorcityarabia.description");
    notificationManager.createNotificationChannel(channel);

}


NotificationCompat.Builder notifiBuilder = new NotificationCompat.Builder(ctx.getApplicationContext(),"default")
        .setSmallIcon(R.drawable.ic_mca_launcher)
        .setContentTitle(title_app)
        .setContentText(body)
        .setGroup(group_id)
        .setGroupSummary(true)
        .setAutoCancel(true)
            .setSound(notificationSound)
            .setContentIntent(pendingIntent);
 notificationManager.notify(notificationID /*ID of notification*/, notifiBuilder.build());

0 个答案:

没有答案