mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-19 23:40:20 +08:00
Ensure notificationId is set before constructing IOSNotification
This commit is contained in:
@@ -42,6 +42,15 @@ export default class Notification {
|
||||
nativeNotification?: NativeNotification,
|
||||
notifications: Notifications
|
||||
) {
|
||||
if (nativeNotification) {
|
||||
this._body = nativeNotification.body;
|
||||
this._data = nativeNotification.data;
|
||||
this._notificationId = nativeNotification.notificationId;
|
||||
this._sound = nativeNotification.sound;
|
||||
this._subtitle = nativeNotification.subtitle;
|
||||
this._title = nativeNotification.title;
|
||||
}
|
||||
|
||||
this._android = new AndroidNotification(
|
||||
this,
|
||||
nativeNotification && nativeNotification.android
|
||||
@@ -52,15 +61,6 @@ export default class Notification {
|
||||
nativeNotification && nativeNotification.ios
|
||||
);
|
||||
|
||||
if (nativeNotification) {
|
||||
this._body = nativeNotification.body;
|
||||
this._data = nativeNotification.data;
|
||||
this._notificationId = nativeNotification.notificationId;
|
||||
this._sound = nativeNotification.sound;
|
||||
this._subtitle = nativeNotification.subtitle;
|
||||
this._title = nativeNotification.title;
|
||||
}
|
||||
|
||||
// Defaults
|
||||
this._data = this._data || {};
|
||||
// TODO: Is this the best way to generate an ID?
|
||||
|
||||
Reference in New Issue
Block a user