iOS Specific Commands

registerRemoteNotifications(options?: NotificationPermissionOptions)

Requests notification permissions from iOS, prompting the user's dialog box if needed.

Notification permission options:

  • providesAppNotificationSettings - An option indicating the iOS notification settings to display a button for in-app notification settings and to be informed in the app on this event.
  • provisional - Use provisional authorization to send notifications on a trial basis. Users can then evaluate the notifications and decide whether to authorize them.
  • carPlay - The ability to display notifications in a CarPlay environment.
  • criticalAlert - Requests notification permissions from iOS, prompting the user's dialog box. Options may request criticalAlert but you must first Request a Critical Alert Notifications Entitlement.
Notifications.ios.registerRemoteNotifications({
providesAppNotificationSettings: true,
provisional: true,
carPlay: true,
criticalAlert: true,
});

checkPermissions()

See what push permissions are currently enabled.

Notifications.ios.checkPermissions();

abandonPermissions()

Unregister for all remote notifications received via Apple Push Notification service.

You should call this method in rare circumstances only, such as when a new version of the app removes support for all types of remote notifications. Users can temporarily prevent apps from receiving remote notifications through the Notifications section of the Settings app. Apps unregistered through this method can always re-register.

Notifications.ios.abandonPermissions();

registerPushKit()

Register for PushKit notifications

Notifications.ios.registerPushKit();

cancelAllLocalNotifications()

Cancels all scheduled localNotifications

Notifications.ios.cancelAllLocalNotifications();

getDeliveredNotifications()

Provides you with a list of the app’s notifications that are still displayed in Notification Center

Notifications.ios.getDeliveredNotifications();

removeDeliveredNotifications()

Removes the specified notifications from Notification Center

Notifications.ios.removeDeliveredNotifications(identifiers);

getBadgeCount()

Gets the badge count number from the aps object

Notifications.ios.getBadgeCount();

setBadgeCount()

Sets the badge number for the app icon on the home screen

Notifications.ios.setBadgeCount(1);