Inherits from NSObject
Declared in Bit6PushNotificationCenter.h

Overview

Bit6PushNotificationCenter is used to handle the remote notifications.

Properties

deviceToken

The regular APNS push token for this device.

@property (nullable, nonatomic, readonly) NSString *deviceToken

Declared In

Bit6PushNotificationCenter.h

voipToken

The VoIP APNS push token for this device.

@property (nullable, nonatomic, readonly) NSString *voipToken

Declared In

Bit6PushNotificationCenter.h

Class Methods

addressForMessageNotification:

Gets the origin identity for the incoming message notification userInfo param.

+ (nullable Bit6Address *)addressForMessageNotification:(NSDictionary *)userInfo

Parameters

userInfo

A dictionary that contains information related to the remote notification.

Return Value

the origin identity for the incoming message.

Declared In

Bit6PushNotificationCenter.h

isAppStoreEnvironment

Returns NO if the device is running in Sandbox.

+ (BOOL)isAppStoreEnvironment

Return Value

NO if the device is running in Sandbox.

Declared In

Bit6PushNotificationCenter.h

isIncomingCallNotification:

Used to know if a push notification refers to an incoming call

+ (BOOL)isIncomingCallNotification:(NSDictionary *)userInfo

Parameters

userInfo

A dictionary that contains information related to the remote notification.

Return Value

true if the push notification refers to an incoming call.

Declared In

Bit6PushNotificationCenter.h

isIncomingMessageNotification:

Used to know if a push notification refers to an incoming message.

+ (BOOL)isIncomingMessageNotification:(NSDictionary *)userInfo

Parameters

userInfo

A dictionary that contains information related to the remote notification.

Return Value

true if the push notification refers to an incoming message.

Declared In

Bit6PushNotificationCenter.h

isMissedCallNotification:

Used to know if a push notification refers to a missed incoming call.

+ (BOOL)isMissedCallNotification:(NSDictionary *)userInfo

Parameters

userInfo

A dictionary that contains information related to the remote notification.

Return Value

true if the push notification refers to a missed incoming call.

Declared In

Bit6PushNotificationCenter.h

Instance Methods

didFailToRegisterForRemoteNotificationsWithError:

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

- (void)didFailToRegisterForRemoteNotificationsWithError:(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

didReceiveNotificationUserInfo:

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

- (void)didReceiveNotificationUserInfo:(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

didReceiveNotificationUserInfo:fetchCompletionHandler:

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

- (void)didReceiveNotificationUserInfo:(NSDictionary *)userInfo fetchCompletionHandler:(nullable 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:(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:forNotificationUserInfo:completionHandler:

Should be called inside the -[UIApplicationDelegate application:handleActionWithIdentifier:forRemoteNotification:completionHandler:] and -[UIApplicationDelegate application:handleActionWithIdentifier:forLocalNotification:completionHandler:] implementations.

- (void)handleActionWithIdentifier:(nullable NSString *)identifier forNotificationUserInfo:(NSDictionary *)userInfo completionHandler:(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

handleActionWithIdentifier:forNotificationUserInfo:withResponseInfo:completionHandler:

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

- (void)handleActionWithIdentifier:(nullable NSString *)identifier forNotificationUserInfo:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(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.

responseInfo

The data dictionary sent by the action.

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

init

Unavailable init. Use Bit6.pushNotification instead.

- (instancetype)init

Return Value

a new instance of the class.

Declared In

Bit6PushNotificationCenter.h

pushRegistry:didReceiveIncomingPushWithPayload:forType:

This method is invoked when a push notification has been received for the specified PKPushType.

- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type

Parameters

registry

The PKPushRegistry instance responsible for the delegate callback.

payload

The push payload sent by a developer via APNS server API.

type

This is a PKPushType NSString constant which is present in [registry desiredPushTypes].

Declared In

Bit6PushNotificationCenter.h

pushRegistry:didUpdatePushCredentials:forType:

This method is invoked when new credentials (including push token) have been received for the specified PKPushType.

- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(PKPushType)type

Parameters

registry

The PKPushRegistry instance responsible for the delegate callback.

credentials

The push credentials that can be used to send pushes to the device for the specified PKPushType.

type

This is a PKPushType NSString constant which is present in [registry desiredPushTypes].

Declared In

Bit6PushNotificationCenter.h

setCategories:

Register custom categories in the Push Notifications system. This method should be called before [Bit6 startWithApiKey:].

- (void)setCategories:(NSArray<UIUserNotificationCategory*> *)categories

Parameters

categories

array of categories to register.

Discussion

Note: These identifiers cannot be used in custom categories/actions: com.bit6.actionDecline, com.bit6.actionAnswer, com.bit6.msgReply, com.bit6.incomingCall, reply.

Declared In

Bit6PushNotificationCenter.h

setNotificationCategories:

Register custom categories in the Push Notifications system. This method should be called before [Bit6 startWithApiKey:].

- (void)setNotificationCategories:(NSArray<UNNotificationCategory*> *)notificationCategories

Parameters

notificationCategories

array of categories to register.

Discussion

Note: These identifiers cannot be used in custom categories/actions: com.bit6.actionDecline, com.bit6.actionAnswer, com.bit6.msgReply, com.bit6.incomingCall, reply.

Declared In

Bit6PushNotificationCenter.h

userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:

Should be called inside the -[UNUserNotificationCenterDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] implementation.

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void ( ^ ) ( ))completionHandler

Parameters

center

The notification center that received the notification.

response

The user’s response to the notification. This object contains the original notification and the identifier string for the selected action. If the action allowed the user to provide a textual response, this object is an instance of the UNTextInputNotificationResponse class.

completionHandler

The block to execute when you have finished processing the user’s response. You must execute this block from your method and should call it as quickly as possible. The block has no return value or parameters.

Declared In

Bit6PushNotificationCenter.h

userNotificationCenter:willPresentNotification:withCompletionHandler:

Should be called inside the -[UNUserNotificationCenterDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] implementation.

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void ( ^ ) ( UNNotificationPresentationOptions options ))completionHandler

Parameters

center

The notification center that received the notification.

notification

The notification that is about to be delivered. Use the information in this object to determine an appropriate course of action. For example, you might use the arrival of the notification to fetch new content or update your app’s interface.

completionHandler

The block to execute with the presentation option for the notification. Always execute this block at some point during your implementation of this method. Specify an option indicating how you want the system to alert the user, if at all.

Declared In

Bit6PushNotificationCenter.h