merge master

This commit is contained in:
David Gruseck
2018-07-13 09:29:10 +02:00
89 changed files with 9582 additions and 8200 deletions

View File

@@ -92,20 +92,41 @@ 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`'
)
);
if (Platform.OS === 'android') {
if (typeof tag !== 'string') {
throw new Error(
`AndroidNotifications:removeDeliveredNotificationsByTag expects an 'string' but got type ${typeof tag}`
);
}
return getNativeModule(
this._notifications
).removeDeliveredNotificationsByTag(tag);
}
return getNativeModule(
this._notifications
).removeDeliveredNotificationsByTag(tag);
return Promise.resolve();
}
deleteChannelGroup(groupId: string): Promise<void> {
if (Platform.OS === 'android') {
if (typeof groupId !== 'string') {
throw new Error(
`AndroidNotifications:deleteChannelGroup expects an 'string' but got type ${typeof groupId}`
);
}
return getNativeModule(this._notifications).deleteChannelGroup(groupId);
}
return Promise.resolve();
}
deleteChannel(channelId: string): Promise<void> {
if (Platform.OS === 'android') {
if (typeof channelId !== 'string') {
throw new Error(
`AndroidNotifications:deleteChannel expects an 'string' but got type ${typeof channelId}`
);
}
return getNativeModule(this._notifications).deleteChannel(channelId);
}
return Promise.resolve();
}
}