mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-07 18:37:42 +08:00
Add Android API to delete channel and channel group
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user