Ensure notificationId is set before constructing IOSNotification

This commit is contained in:
Ryan Grey 2018-08-15 10:24:24 +01:00
parent 0af7c02955
commit cfb5f3a304
1 changed files with 9 additions and 9 deletions

View File

@ -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?