mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-10 22:03:38 +08:00
merge master
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user