Last active
October 12, 2018 17:15
-
-
Save AliAsadi/f3031d854356b8a0e595e9ef7a68a379 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
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { | |
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "Default", NotificationManager.IMPORTANCE_DEFAULT); | |
channel.setVibrationPattern(new long[0]); | |
channel.enableVibration(false); | |
channel.setSound(null,null); | |
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); | |
if (notificationManager != null) { | |
notificationManager.createNotificationChannel(channel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment