Last active
June 8, 2021 23:59
-
-
Save victorbrndls/686fa3509c794b31871826e1f06cb756 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
private fun createNotification(): Notification { | |
val contentIntent = Intent(context, HomeActivity::class.java) | |
val contentPendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0) | |
return NotificationCompat.Builder(context, CHANNEL_ID) | |
.setSmallIcon(R.drawable.notifications_active_black_24) | |
.setColor(ResourcesCompat.getColor(context.resources, R.color.purple_200, null)) | |
.setContentTitle(context.getString(R.string.notification_title)) | |
.setAutoCancel(true) | |
.setContentIntent(contentPendingIntent) | |
.setPriority(NotificationCompat.PRIORITY_HIGH) | |
.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment