Skip to content

Instantly share code, notes, and snippets.

@EfeBudak
Created August 15, 2019 08:15
Show Gist options
  • Save EfeBudak/2fe19f7aec45a933111f041011b014ad to your computer and use it in GitHub Desktop.
Save EfeBudak/2fe19f7aec45a933111f041011b014ad to your computer and use it in GitHub Desktop.
override fun onReceive(context: Context?, intent: Intent?) {
context?.let {
Log.d("InteractiveNotificationBroadcastReceiver", "onReceive")
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Interactive Notification Title")
.setContentText("MODIFIED text")
.setContentIntent(newPendingIntent(context))
.build()
NotificationManagerCompat.from(context)
.notify(INTERACTIVE_NOTIFICATION_ID, notification)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment