Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.1 kB
7
Indexable
Never
 private void customnotification() {
        SMTNotificationChannel.Builder smtBuilder = new SMTNotificationChannel.Builder(
                "channelid",
                "channelname",
                NotificationManager.IMPORTANCE_HIGH);
//To set the description to the channel add below method.
        smtBuilder.setChannelDescription("this is custom sound notification");

//To set the group ID to the channel add below method. (Make sure that before setting group ID here, that group must be created before. Check the code below)
        smtBuilder.setChannelGroupId("custom sound group");

//To set sound to channel, add below method. (Note that sound name must be without extention.)
        smtBuilder.setNotificationSound("bell_notification");
        SmartPush.getInstance(new WeakReference<>(this)).createNotificationChannelGroup("testandroid", "testgroup");


        SMTNotificationChannel smtNotificationChannel = smtBuilder.build();
        SmartPush.getInstance(new WeakReference<>(this)).createNotificationChannel(smtNotificationChannel);

    }
Leave a Comment