Inherits from NSObject
Declared in Bit6PushNotificationCenter.h

Overview

Bit6PushNotificationCenter is used to handle the remote notifications.

Instance Methods

didFailToRegisterForRemoteNotificationsWithError:

Should be called inside the -[UIApplicationDelegate application:didFailToRegisterForRemoteNotificationsWithError:] implementation.

- (void)didFailToRegisterForRemoteNotificationsWithError:(nonnull NSError *)error

Parameters

error

An NSError object that encapsulates information why registration did not succeed. The app can choose to display this information to the user.

Declared In

Bit6PushNotificationCenter.h

didReceiveRemoteNotification:

Should be called inside the -[UIApplicationDelegate application:didReceiveRemoteNotification:] implementation.

- (void)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo

Parameters

userInfo

A dictionary that contains information related to the remote notification, potentially including a badge number for the app icon, an alert sound, an alert message to display to the user, a notification identifier, and custom data. The provider originates it as a JSON-defined dictionary that iOS converts to an NSDictionary object; the dictionary may contain only property-list objects plus NSNull.

Declared In

Bit6PushNotificationCenter.h

didReceiveRemoteNotification:fetchCompletionHandler:

Should be called inside the -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] implementation.

- (void)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void ( ^ ) ( UIBackgroundFetchResult ))completionHandler

Parameters

userInfo

A dictionary that contains information related to the remote notification, potentially including a badge number for the app icon, an alert sound, an alert message to display to the user, a notification identifier, and custom data. The provider originates it as a JSON-defined dictionary that iOS converts to an NSDictionary object; the dictionary may contain only property-list objects plus NSNull.

completionHandler

The block to execute when the download operation is complete. When calling this block, pass in the fetch result value that best describes the results of your download operation. You must call this handler and should do so as soon as possible.

Declared In

Bit6PushNotificationCenter.h

didRegisterForRemoteNotificationsWithDeviceToken:

Should be called inside the -[UIApplicationDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] implementation.

- (void)didRegisterForRemoteNotificationsWithDeviceToken:(nonnull NSData *)deviceToken

Parameters

deviceToken

A token that identifies the device to APS. The token is an opaque data type because that is the form that the provider needs to submit to the APS servers when it sends a notification to a device. The APS servers require a binary format for performance reasons. The size of a device token is 32 bytes. Note that the device token is different from the uniqueIdentifier property of UIDevice because, for security and privacy reasons, it must change when the device is wiped.

Declared In

Bit6PushNotificationCenter.h

handleActionWithIdentifier:forRemoteNotification:completionHandler:

Should be called inside the -[UIApplicationDelegate application:handleActionWithIdentifier:forRemoteNotification:completionHandler:] implementation.

- (void)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(nonnull NSDictionary *)userInfo completionHandler:(nonnull void ( ^ ) ( ))completionHandler

Parameters

identifier

The identifier associated with the custom action.

userInfo

A dictionary that contains information related to the remote notification. This dictionary originates from the provider as a JSON-defined dictionary, which iOS converts to an NSDictionary object before calling this method. The contents of the dictionary are the push notification payload, which consists only of property-list objects plus NSNull.

completionHandler

The block to execute when you are finished performing the specified action. You must call this block at the end of your method.

Declared In

Bit6PushNotificationCenter.h