-
-
Save hitherejoe/1ad7db575a0255e3d77753ef9999dcbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NotificationManager notificationManager = | |
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); | |
String channelId = "some_channel_id"; | |
CharSequence channelName = "Some Channel"; | |
int importance = NotificationManager.IMPORTANCE_LOW; | |
NotificationChannel notificationChannel = new NotificationChannel(channelId, channelName, importance); | |
notificationChannel.enableLights(true); | |
notificationChannel.setLightColor(Color.RED); | |
notificationChannel.enableVibration(true); | |
notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); | |
notificationManager.createNotificationChannel(notificationChannel); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment