Notification SDK Client 4.34.0
Loading...
Searching...
No Matches
NotificationSDKClient Class Reference

#include <NotificationSDKClient.h>

Inherits NSObject.

Instance Methods

(typedef) - NS_OPTIONS
 

Class Methods

(BOOL) + registerNotificationServiceWithNotificationSettings:error:
 
(NSString *_Nullable) + getOneSpanNotificationIdentifier:error:
 
(BOOL) + isOneSpanNotification:
 
(NSString *_Nullable) + parseOneSpanNotification:error:
 
(NSString *_Nullable) + getTitle:
 
(NSString *_Nullable) + getSubject:
 
(NSNumber *_Nullable) + getBadgeValue:
 
(NSDictionary< NSString *, NSString * > *_Nullable) + getCustomAttributes:
 

Detailed Description

This class provides the main functions of the Notification SDK Client.

Method Documentation

◆ getBadgeValue:

+ (NSNumber *_Nullable) getBadgeValue: (NSDictionary *) notification

Get the value of the badge of a OneSpan Notification.

Parameters
notificationThe NSDictionary provided by the system.
Returns
the value of the badge field if it is present, nil otherwise.

◆ getCustomAttributes:

+ (NSDictionary< NSString *, NSString * > *_Nullable) getCustomAttributes: (NSDictionary *) notification

Get the custom Attributes of a OneSpan Notification.

Parameters
notificationThe NSDictionary provided by the system.
Returns
the custom attributes if found, else returns nill.

◆ getOneSpanNotificationIdentifier:error:

+ (NSString *_Nullable) getOneSpanNotificationIdentifier: (NSData *) devToken
error: (NSError **_Nullable) error 

Get the OneSpan Notification Identifier as a string from the devToken provided by the dedicated system callback, after using the NotificationSDKClient#registerNotificationServiceWithNotificationSettings:error: method.

Parameters
devTokenreceived from the server in the dedicated system callback. This parameter cannot be null.
errora NSError raised if there is an error during the process.
Returns
the calculated OneSpan notification identifier

◆ getSubject:

+ (NSString *_Nullable) getSubject: (NSDictionary *) notification

Get the subject from the notification provided as a NSDictionary and returns the associated content as a NString.

Parameters
notificationThe NSDictionary provided by the system.
Returns
the subject of the message associated with the notification that has been parsed.

◆ getTitle:

+ (NSString *_Nullable) getTitle: (NSDictionary *) notification

Get the title from the notification provided as a NSDictionary and returns it as a NString.

Parameters
notificationThe NSDictionary provided by the system.
Returns
the title of the message associated with the notification that has been parsed.

◆ isOneSpanNotification:

+ (BOOL) isOneSpanNotification: (NSDictionary *) notification

Check if the provided NSDictionary is a valid OneSpan notification.

Parameters
notificationThe NSDictionary provided by the system.
Returns
true if the provided NSDictionary is a valid OneSpan notification, false otherwise.

◆ NS_OPTIONS

- (typedef) NS_OPTIONS (NSUInteger)
(NotificationSDKClientNotificationType)  

NotificationSDKClientNotificationType object used to configure the type of interactions the created notification should have with the user and the system.
Values that can be used (composition with binary or |):

  • NotificationSDKClientNotificationTypeNone: no alteration;
  • NotificationSDKClientNotificationTypeBadge: use the badge on icon;
  • NotificationSDKClientNotificationTypeSound: use a sound for the notification;
  • NotificationSDKClientNotificationTypeAlert: use an alert for the notification.

◆ parseOneSpanNotification:error:

+ (NSString *_Nullable) parseOneSpanNotification: (NSDictionary *) notification
error: (NSError **_Nullable) error 

Parses the notification provided as a NSDictionary and returns the associated content as a NString.

Parameters
notificationThe NSDictionary provided by the system.
errora NSError raised if there is an error during the process.
Returns
the content of the message associated with the notification that has been parsed.

◆ registerNotificationServiceWithNotificationSettings:error:

+ (BOOL) registerNotificationServiceWithNotificationSettings: (NotificationSDKClientNotificationType) notificationType
error: (NSError **_Nullable) error 

Register to the Apple push notification service. The OneSpan Notification Identifier must be calculated with the NotificationSDKClient#getOneSpanNotificationIdentifier:error: method from the success callback: (void)application:(UIApplication *)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) In case of failure, the application will be notified with the following callback: (void)application:(UIApplication *)didFailToRegisterForRemoteNotificationsWithError:(NSError *)

Parameters
notificationTypenotificationType to be used (NotificationSDKClientNotificationTypeBadge | NotificationSDKClientNotificationTypeSound | NotificationSDKClientNotificationTypeAlert).
errora NSError raised if there is an error during the process.
Returns
true if the call is successful, If an error occurred the reason will be put in the error.

The documentation for this class was generated from the following file: