[Android] Add the ability to remove notifications based on the tag

This commit is contained in:
David Gruseck
2018-05-07 17:35:10 +02:00
parent 19b226b048
commit 89806d97f7
8 changed files with 68 additions and 5 deletions

View File

@@ -343,6 +343,13 @@ RCT_EXPORT_METHOD(removeDeliveredNotification:(NSString*) notificationId
resolve(nil);
}
RCT_EXPORT_METHOD(removeDeliveredNotificationsByTag:(NSString*) tag
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
// No implementation for ios
resolve(nil);
}
RCT_EXPORT_METHOD(scheduleNotification:(NSDictionary*) notification
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
@@ -372,7 +379,7 @@ RCT_EXPORT_METHOD(setBadge:(NSInteger) number
resolve(nil);
});
}
RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
jsReady = TRUE;
resolve(nil);
@@ -487,11 +494,11 @@ RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
NSString *identifier = a[@"identifier"];
NSURL *url = [NSURL fileURLWithPath:a[@"url"]];
NSMutableDictionary *attachmentOptions = nil;
if (a[@"options"]) {
NSDictionary *options = a[@"options"];
attachmentOptions = [[NSMutableDictionary alloc] init];
for (id key in options) {
if ([key isEqualToString:@"typeHint"]) {
attachmentOptions[UNNotificationAttachmentOptionsTypeHintKey] = options[key];