Files
react-native-notifications/docs/general-events.md
2019-09-09 15:39:28 +03:00

1.1 KiB
Executable File

id, title, sidebar_label
id title sidebar_label
general-events General General

registerRemoteNotificationsRegistered

registerRemoteNotificationsRegistered

Notifications.events().registerRemoteNotificationsRegistered((event: Registered) => {
  console.log(event.deviceToken);
});

registerNotificationReceived

registerNotificationReceived

Notifications.events().registerNotificationReceived((notification: Notification, completion: (response: NotificationCompletion) => void) => {
  console.log(JSON.stringify(notification.data));

  // Calling completion on iOS with `alert: true` will present the native iOS inApp notification.
  completion({alert: true, sound: true, badge: false});
});

registerRemoteNotificationOpened

registerRemoteNotificationOpened

Notifications.events().registerRemoteNotificationOpened((notification: Notification) => {
  console.log(JSON.stringify(notification.data));
});

registerRemoteNotificationsRegistrationFailed

registerRemoteNotificationsRegistrationFailed

Notifications.events().registerRemoteNotificationsRegistrationFailed(() => {
  
});