diff --git a/docs/pushnotificationios.html b/docs/pushnotificationios.html index e162a84f0a6..d920550343c 100644 --- a/docs/pushnotificationios.html +++ b/docs/pushnotificationios.html @@ -1,14 +1,19 @@ PushNotificationIOS – React Native | A framework for building native apps using React

PushNotificationIOS

Handle push notifications for your app, including permission handling and icon badge number.

To get up and running, configure your notifications with Apple -and your server-side system. To get an idea, this is the Parse guide.

To enable support for notification and register events you need to augment your AppDelegate.

At the top of your AppDelegate.m:

#import "RCTPushNotificationManager.h"

And then in your AppDelegate implementation add the following:

// Required for the register event. +and your server-side system. To get an idea, this is the Parse guide.

To enable support for notification and register events you need to augment your AppDelegate.

At the top of your AppDelegate.m:

#import "RCTPushNotificationManager.h"

And then in your AppDelegate implementation add the following:

// Required to register for notifications + - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings + { + [RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings]; + } + // Required for the register event. - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + [RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } // Required for the notification event. - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification { - [RCTPushNotificationManager application:application didReceiveRemoteNotification:notification]; + [RCTPushNotificationManager didReceiveRemoteNotification:notification]; }

Methods #

static presentLocalNotification(details: Object) #

Schedules the localNotification for immediate presentation.

details is an object containing:

  • alertBody : The message displayed in the notification alert.

static scheduleLocalNotification(details: Object) #

Schedules the localNotification for future presentation.

details is an object containing:

  • fireDate : The date and time when the system should deliver the notification.
  • alertBody : The message displayed in the notification alert.

static cancelAllLocalNotifications() #

Cancels all scheduled localNotifications

static setApplicationIconBadgeNumber(number: number) #

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

static getApplicationIconBadgeNumber(callback: Function) #

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

static addEventListener(type: string, handler: Function) #

Attaches a listener to remote 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.
  • register: Fired when the user registers for remote notifications. The