Add Android API to delete channel and channel group

This commit is contained in:
Dariusz Luksza
2018-05-13 22:16:46 +02:00
parent bcd655d765
commit 57901cd29a
4 changed files with 54 additions and 0 deletions

View File

@@ -91,4 +91,32 @@ export default class AndroidNotifications {
}
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();
}
}