Commit 1cac5d24 authored by Henry Moule's avatar Henry Moule

delete notification channel method

parent 4bcc5d1b
......@@ -123,6 +123,15 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
promise.resolve(null);
}
@ReactMethod
public void deleteNotificationChannel(String id, Promise promise) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationManager mngr = (NotificationManager) getReactApplicationContext().getSystemService(NOTIFICATION_SERVICE);
mngr.deleteNotificationChannel(id);
}
promise.resolve(null);
}
@ReactMethod
public void getFCMToken(Promise promise) {
try {
......
......@@ -96,6 +96,12 @@ FCM.createNotificationChannel = (channel) => {
}
}
FCM.deleteNotificationChannel = (channel) => {
if (Platform.OS === 'android') {
return RNFIRMessaging.deleteNotificationChannel(channel);
}
}
FCM.presentLocalNotification = (details) => {
details.id = details.id || new Date().getTime().toString();
details.local_notification = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment