OPPushClient Class Reference

Inherits from NSObject
Conforms to GGLInstanceIDDelegate
Declared in OPPushClient.h
OPPushClient.m

Overview

Main class to interact with the optivo broadmail push notifications service.

Properties

  logLevel

Specifies the amount of logging information that should be output. The default value is OPLogLevelError.

@property (assign) OPLogLevel logLevel

Declared In

OPPushClient.h

  lastReceivedTrackingUrl

The tracking URL that was last received via a push notification.

@property (nonatomic, strong) NSString *lastReceivedTrackingUrl

Declared In

OPPushClient.h

Global Information

+ appSDKVersion

Returns the version of the optivo SDK.

+ (NSString *)appSDKVersion

Return Value

The SDK version string.

Declared In

OPPushClient.h

Initializer

– initWithPackageName:authenticationToken:supportedPayloadParameters:useSandboxServers:

Initializes a new OPPushClient instance to communicate with the optivo broadmail servers.

- (id)initWithPackageName:(NSString *)packageName authenticationToken:(NSString *)authenticationToken supportedPayloadParameters:(NSArray *)supportedPayloadParameters useSandboxServers:(BOOL)useSandboxServers

Parameters

packageName

Package name of this application. Used to identify this app.

authenticationToken

optivo Authentication Token. Used to identify this client.

supportedPayloadParameters

Collection of valid parameters which can be pushed as payload to this app.

useSandboxServers

Whether the app is using the sandbox or production APNS servers. If the app is signed with a Development Certificate and a Development Provisioning Profile, this value must be true. If the app is signed with a Distribution Certificate and a Distribution Provisioning Profile, this value must be false.

Return Value

A fully initialized OPPushClient instance.

Declared In

OPPushClient.h

Managing Recipient Data

– setRecipientId:idValue:

Associate a unique identifier with the device on the optivo broadmail servers.

- (void)setRecipientId:(NSString *)recipientIdField idValue:(NSString *)idValue

Parameters

recipientIdField

The name of the field used to store the recipient identifier.

idValue

The recipient identifier to associate with the device.

Declared In

OPPushClient.h

– updateRecipientData:

Update the recipient information which is associated with the device on the optivo broadmail servers. The recipient information can later be used for creating target groups and sending data only to a select subset of registered devices.

- (void)updateRecipientData:(NSDictionary *)recipientData

Parameters

recipientData

The recipient data as NSString-to-NSString key value pairs.

Declared In

OPPushClient.h

– acceptNotifications:

Update the information whether the user would like to receive notifications or not. Default is true.

- (void)acceptNotifications:(BOOL)acceptNotifications

Parameters

acceptNotifications

Whether the user would like to receive notification or not

Declared In

OPPushClient.h

Tracking Message Openings

– trackOpen:

Opens the given tracking URL for reporting the receival of a push notification.

- (void)trackOpen:(NSString *)trackingUrl

Parameters

trackingUrl

The tracking URL that was included in the push notification payload.

Declared In

OPPushClient.h

Observing State

– observeRegistrationNotification:selector:

Registers the given observer object for being notified when the device registration has completed.

- (void)observeRegistrationNotification:(id)notificationObserver selector:(SEL)notificationSelector

Parameters

notificationObserver

The object to be notified.

notificationSelector

The selector to invoke when the device registration has completed. The selector must have a single argument of type NSNotification.

Declared In

OPPushClient.h

– observeMessageNotification:selector:

Registers the given observer object for being notified when a message is received.

- (void)observeMessageNotification:(id)notificationObserver selector:(SEL)notificationSelector

Parameters

notificationObserver

The object to be notified.

notificationSelector

The selector to invoke when the message is received. The selector must have a single argument of type NSNotification.

Declared In

OPPushClient.h

– removeObserverForRegistrationNotification:

Removes an object that is currently registered for being notified when the device registration has completed.

- (void)removeObserverForRegistrationNotification:(id)notificationObserver

Parameters

notificationObserver

The object to be notified.

Declared In

OPPushClient.h

– removeObserverForMessageNotification:

Removes an object that is currently registered for being notified when a message is received.

- (void)removeObserverForMessageNotification:(id)notificationObserver

Parameters

notificationObserver

The object to be notified.

Declared In

OPPushClient.h