Inherits from NSObject
Declared in KNYMessagingService.h

Overview

KNYMessagingService for using push notifications

Class Methods

sharedMessagingService

Throws exception, when invoked before initialializing the KNYClient.

+ (instancetype)sharedMessagingService

Return Value

Returns the shared instance of KNYMessagingService

Discussion

Throws exception, when invoked before initialializing the KNYClient.

Declared In

KNYMessagingService.h

Instance Methods

fetchAllMessagesInBackgroundWithStartIndex:pageSize:completion:

Fetch all messages

- (NSOperation *)fetchAllMessagesInBackgroundWithStartIndex:(NSUInteger)startIndex pageSize:(NSUInteger)pageSize completion:(void ( ^ ) ( NSDictionary *messages , NSError *error ))completion

Parameters

startIndex

start message index

pageSize

number of messages per page

completion

The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)

Return Value

Returns an NSOperation instance object.

Discussion

Fetch all messages

Declared In

KNYMessagingService.h

fetchMessageContentInBackgroundWithMessageId:completion:

Fetch complete message

- (NSOperation *)fetchMessageContentInBackgroundWithMessageId:(NSString *)messageId completion:(void ( ^ ) ( NSString *message , NSError *error ))completion

Parameters

messageId

message id

completion

The block to execute. The block should have the following argument signature: (NSString string, NSError error)

Return Value

Returns an NSOperation instance object.

Discussion

Fetch complete message

Declared In

KNYMessagingService.h

init

- (id)init

markMessageReadInBackgroundWithMessageId:completion:

Mark message as read

- (NSOperation *)markMessageReadInBackgroundWithMessageId:(NSString *)messageId completion:(void ( ^ ) ( BOOL succeeded , NSError *error ))completion

Parameters

messageId

message id

completion

The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)

Return Value

Returns an NSOperation instance object.

Discussion

Mark message as read

Declared In

KNYMessagingService.h

registerInBackgroundWithDeviceToken:alias:completion:

Register for messaging

- (NSOperation *)registerInBackgroundWithDeviceToken:(NSData *)deviceToken alias:(NSString *)alias completion:(void ( ^ ) ( BOOL succeeded , NSError *error ))completion

Parameters

deviceToken

device token

alias

alias

completion

The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)

Return Value

Returns an NSOperation instance object.

Discussion

Register for messaging

Declared In

KNYMessagingService.h

setMessagingServiceEndPoint:

endPoint messaging Service URL

- (void)setMessagingServiceEndPoint:(NSString *)URLString

Parameters

URLString

endPoint messaging Service URL

Declared In

KNYMessagingService.h

unregisterInBackgroundUsingCompletionBlock:

Unregister from messaging

- (NSOperation *)unregisterInBackgroundUsingCompletionBlock:(void ( ^ ) ( BOOL succeeded , NSError *error ))completion

Parameters

completion

The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)

Return Value

Returns an NSOperation instance object.

Discussion

Unregister from messaging

Declared In

KNYMessagingService.h

updateGeoLocationInBackgroundWithLatitude:longitude:locationName:completion:

update geo location

- (NSOperation *)updateGeoLocationInBackgroundWithLatitude:(double)latitude longitude:(double)longitude locationName:(NSString *)locationName completion:(void ( ^ ) ( BOOL succeeded , NSError *error ))completion

Parameters

latitude

latitude

longitude

logitude

locationName

location name

completion

The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)

Return Value

Returns an NSOperation instance object.

Discussion

update geo location

Declared In

KNYMessagingService.h