Skip to content

Instantly share code, notes, and snippets.

@timrijckaert
Created April 9, 2019 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timrijckaert/b31ff01c1ded0ac5bf9e71a374a9b48b to your computer and use it in GitHub Desktop.
Save timrijckaert/b31ff01c1ded0ac5bf9e71a374a9b48b to your computer and use it in GitHub Desktop.
private fun createNotification(channelId: String, text: String, title: String, id: String, url: String, bigImage: Bitmap, pillImage: Bitmap): Notification {
return NotificationCompat.Builder(context, channelId)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(createPendingIntent(id, url))
.setAutoCancel(true)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setSound(soundHelper.vrtNwsNotificationSound)
.setDefaults(NotificationCompat.DEFAULT_VIBRATE)
.setCustomBigContentView(createBigContentView(text, bigImage, pillImage))
.build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment