[notifications] Make title and body optional fields
This commit is contained in:
parent
548086db7a
commit
0645d179b3
|
@ -143,16 +143,10 @@ export default class Notification {
|
||||||
}
|
}
|
||||||
|
|
||||||
build(): NativeNotification {
|
build(): NativeNotification {
|
||||||
// Android required fields: body, title, smallicon
|
if (!this._notificationId) {
|
||||||
// iOS required fields: TODO
|
|
||||||
if (!this._body) {
|
|
||||||
throw new Error('Notification: Missing required `body` property');
|
|
||||||
} else if (!this._notificationId) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Notification: Missing required `notificationId` property'
|
'Notification: Missing required `notificationId` property'
|
||||||
);
|
);
|
||||||
} else if (!this._title) {
|
|
||||||
throw new Error('Notification: Missing required `title` property');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue