applicationIconBadgeNumber (optional) : The number to display as the app's icon badge. Setting the number to 0 removes the icon badge.

cancelAllLocalNotifications()

staticcancelAllLocalNotifications()

Cancels all scheduled localNotifications

setApplicationIconBadgeNumber()

staticsetApplicationIconBadgeNumber(number)

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

getApplicationIconBadgeNumber()

staticgetApplicationIconBadgeNumber(callback)

Gets the current badge number for the app icon on the home screen

cancelLocalNotifications()

staticcancelLocalNotifications(userInfo)

Cancel local notifications.

Optionally restricts the set of canceled notifications to those notifications whose userInfo fields match the corresponding fields in the userInfo argument.

getScheduledLocalNotifications()

staticgetScheduledLocalNotifications(callback)

Gets the local notifications that are currently scheduled.

addEventListener()

staticaddEventListener(type, handler)

Attaches a listener to remote or local notification events while the app is running in the foreground or the background.

Valid events are:

notification : Fired when a remote notification is received. The handler will be invoked with an instance of PushNotificationIOS.

localNotification : Fired when a local notification is received. The handler will be invoked with an instance of PushNotificationIOS.

register: Fired when the user registers for remote notifications. The handler will be invoked with a hex string representing the deviceToken.

registrationError: Fired when the user fails to register for remote notifications. Typically occurs when APNS is having issues, or the device is a simulator. The handler will be invoked with {message: string, code: number, details: any}.

removeEventListener()

staticremoveEventListener(type, handler)

Removes the event listener. Do this in componentWillUnmount to prevent memory leaks

requestPermissions()

staticrequestPermissions(permissions?)

Requests notification permissions from iOS, prompting the user's dialog box. By default, it will request all notification permissions, but a subset of these can be requested by passing a map of requested permissions. The following permissions are supported:

alert

badge

sound

If a map is provided to the method, only the permissions with truthy values will be requested.

This method returns a promise that will resolve when the user accepts, rejects, or if the permissions were previously rejected. The promise resolves to the current state of the permission.

abandonPermissions()

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.

checkPermissions()

staticcheckPermissions(callback)

See what push permissions are currently enabled. callback will be invoked with a permissions object:

alert :boolean

badge :boolean

sound :boolean

getInitialNotification()

staticgetInitialNotification()

This method returns a promise that resolves to either the notification object if the app was launched by a push notification, or null otherwise.

constructor()

constructor(nativeNotif);

You will never need to instantiate PushNotificationIOS yourself. Listening to the notification event and invoking getInitialNotification is sufficient