Skip to content

Commit 31f4b1a

Browse files
maxostkroikie
authored andcommitted
added default channel parameter when constructing own notification (firebase#326)
1 parent 08d6c2a commit 31f4b1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

messaging/app/src/main/java/com/google/firebase/quickstart/fcm/MyFirebaseMessagingService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ private void sendNotification(String messageBody) {
114114
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
115115
PendingIntent.FLAG_ONE_SHOT);
116116

117+
String channelId = getString(R.string.default_notification_channel_id);
117118
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
118-
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
119+
NotificationCompat.Builder notificationBuilder =
120+
new NotificationCompat.Builder(this, channelId)
119121
.setSmallIcon(R.drawable.ic_stat_ic_notification)
120122
.setContentTitle("FCM Message")
121123
.setContentText(messageBody)

0 commit comments

Comments
 (0)