move removeDeliveredNotificationsByTag to android specific file

This commit is contained in:
David Gruseck 2018-07-13 09:22:38 +02:00
parent 89806d97f7
commit 8b81e74f50
3 changed files with 17 additions and 22 deletions

View File

@ -343,13 +343,6 @@ 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) {

View File

@ -91,4 +91,21 @@ export default class AndroidNotifications {
}
return Promise.resolve();
}
/**
* Remove a delivered notifications by tag.
* @param tag
*/
removeDeliveredNotificationsByTag(tag: string): Promise<void> {
if (!tag) {
return Promise.reject(
new Error(
'Notifications: removeDeliveredNotificationsByTag expects a `tag`'
)
);
}
return getNativeModule(
this._notifications
).removeDeliveredNotificationsByTag(tag);
}
}

View File

@ -291,21 +291,6 @@ export default class Notifications extends ModuleBase {
return getNativeModule(this).removeDeliveredNotification(notificationId);
}
/**
* Remove a delivered notifications by tag.
* @param tag
*/
removeDeliveredNotificationsByTag(tag: string): Promise<void> {
if (!tag) {
return Promise.reject(
new Error(
'Notifications: removeDeliveredNotificationsByTag expects a `tag`'
)
);
}
return getNativeModule(this).removeDeliveredNotificationsByTag(tag);
}
/**
* Schedule a notification
* @param notification