mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[notifications] Rename onNotificationOpened to onNotificationOpen
This commit is contained in:
@@ -9,7 +9,7 @@ import { generatePushID, isObject } from '../../utils';
|
||||
|
||||
import type { NativeNotification } from './types';
|
||||
|
||||
export type NotificationOpened = {
|
||||
export type NotificationOpen = {
|
||||
action: string,
|
||||
notification: Notification,
|
||||
};
|
||||
|
||||
@@ -22,10 +22,10 @@ import {
|
||||
} from './types';
|
||||
|
||||
import type App from '../core/app';
|
||||
import type { NotificationOpened } from './Notification';
|
||||
import type { NotificationOpen } from './Notification';
|
||||
import type {
|
||||
NativeNotification,
|
||||
NativeNotificationOpened,
|
||||
NativeNotificationOpen,
|
||||
Schedule,
|
||||
} from './types';
|
||||
|
||||
@@ -35,10 +35,10 @@ type OnNotificationObserver = {
|
||||
next: OnNotification,
|
||||
};
|
||||
|
||||
type OnNotificationOpened = NotificationOpened => any;
|
||||
type OnNotificationOpened = NotificationOpen => any;
|
||||
|
||||
type OnNotificationOpenedObserver = {
|
||||
next: OnNotificationOpened,
|
||||
next: OnNotificationOpen,
|
||||
};
|
||||
|
||||
const NATIVE_EVENTS = [
|
||||
@@ -95,10 +95,10 @@ export default class Notifications extends ModuleBase {
|
||||
// sub to internal native event - this fans out to
|
||||
// public event name: onNotificationOpened
|
||||
'notifications_notification_opened',
|
||||
(notificationOpened: NativeNotificationOpened) => {
|
||||
(notificationOpen: NativeNotificationOpen) => {
|
||||
SharedEventEmitter.emit('onNotificationOpened', {
|
||||
action: notificationOpened.action,
|
||||
notification: new Notification(notificationOpened.notification),
|
||||
action: notificationOpen.action,
|
||||
notification: new Notification(notificationOpen.notification),
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -172,7 +172,7 @@ export type NativeNotification = {|
|
||||
title: string,
|
||||
|};
|
||||
|
||||
export type NativeNotificationOpened = {|
|
||||
export type NativeNotificationOpen = {|
|
||||
action: string,
|
||||
notification: NativeNotification,
|
||||
|};
|
||||
|
||||
Reference in New Issue
Block a user