Created
May 13, 2025 08:55
-
-
Save LloydBlv/6ebc41a82647680f63c6f2377cafa02c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
override fun onMessageReceived(remoteMessage: RemoteMessage) { | |
val title = remoteMessage.data["title"] | |
val body = remoteMessage.data["body"] | |
val deeplink = remoteMessage.data["deeplink"] | |
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(deeplink)) | |
val notification = NotificationCompat.Builder(this, "channel_id") | |
.setContentTitle(title) | |
.setContentText(body) | |
.setContentIntent(PendingIntent.getActivity(this, 0, intent, 0)) | |
.build() | |
NotificationManagerCompat.from(this).notify(1, notification) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment