Open Veeresh8 opened 6 years ago
That can be done this way:
NotificationsManager.presentNotification(context, extras, ..., new NotificationsManager.NotificationExtender() {
@Override
public Notification.Builder extendNotification(@NonNull Notification.Builder notification) {
String channelId = getString(R.string.news_channel_id);
if (Constants.SUPPORT_OREO) {
notification.setChannelId(channelId);
}
notification.setSmallIcon(getIconRes());
return notification;
}
});
Is this for in-app notification or the push notification?
hm, I see some code was cut, it's for in-app notifications, updated code above, it's used with NotificationsManager.presentNotification
I can't seem to add the method there, I'm using the gradle dependency. Should I download and include as Library?
@Veeresh8 we use the gradle dependency too 'com.facebook.android:notifications:1.0.2'. Can you see that with notificationExtender?:
public static void presentNotification(
@NonNull final Context context,
@NonNull final Bundle notificationBundle,
@NonNull final Intent launcherIntent,
@Nullable final NotificationExtender notificationExtender) {
you need to pass a NotificationExtender object
Oh, Okay. Thanks!
What is the notification object here?
it's an argument ... its Notification.Builder
Recently tested out the library where the push notifications work properly (Adding notification channels) with Android Oreo but in-app notifications do not work. Please give an option to provide notification channels for in-app notifications.