UNMutableNotificationContent: body property
The body property is the body of the notification.
Value
A string.
- Readable and writable.
- The default is
''. - The content is copied when a request is created. Changing this property after the request is created does not change requests already created.
- Only the app itself can change it; there is no change notification.
Invalid values
- Converted to a string: writing the number
5gives'5'. - Writing
nullorundefinedgives an empty string. - Does not throw.
Examples
js
const content = new UNMutableNotificationContent();
content.title = 'Your order has shipped';
content.body = 'Expected to arrive tomorrow';
console.log(content.body);Result: Prints Expected to arrive tomorrow. The notification shows this body text below the title (not verified in the simulator).
Corresponding iOS API
UNMutableNotificationContent.body.
See also
UNNotificationContent: the read-only property of the same name on content that is read backUNNotificationRequest.requestWithIdentifier(): creating a request from content- This class belongs to the
@nacrejs/user-notificationspackage; for how to install it, see Install first