Inherits from NSObject
Declared in NetmeraPushService.h
NetmeraPushService.m

Overview

This is the main class to manage push notifications in Netmera. With the help of this class, you can register/unregister devices to get notification.

Tasks

Class Methods

getNetmeraDeviceGroupsWithError:

Gets all groups of your application’s token list

+ (NSArray *)getNetmeraDeviceGroupsWithError:(NSError **)error

Parameters

error

if it cannot access server

Discussion

Gets all groups of your application’s token list

Declared In

NetmeraPushService.h

handleNotification:

Handles received push notification content and shows a rich push view to user if notification includes a rich push message.

+ (BOOL)handleNotification:(NSDictionary *)userInfo

Parameters

userInfo

data that comes with the push notification.

Return Value

BOOL Returns YES if notification includes a rich push message. Otherwise, returns NO.

Discussion

Handles received push notification content and shows a rich push view to user if notification includes a rich push message.

Declared In

NetmeraPushService.h

registerInBackgroundWithNetmeraDeviceDetail:

Register any device from any groups in background thread.

+ (void)registerInBackgroundWithNetmeraDeviceDetail:(NetmeraDeviceDetail *)deviceDetail

Parameters

deviceDetail

token and deviceGroupList attributes of NetmeraDeviceDetail instance that you created must not be nil.

Discussion

Register any device from any groups in background thread.

Declared In

NetmeraPushService.h

registerInBackgroundWithToken:

Registers the device into to the server in the background thread and not callback any

+ (void)registerInBackgroundWithToken:(NSString *)token

Parameters

token

application’s deviceToken

Discussion

Registers the device into to the server in the background thread and not callback any

Declared In

NetmeraPushService.h

registerInBackgroundWithToken:withBlock:

Unregisters device in the background thread

+ (void)registerInBackgroundWithToken:(NSString *)token withBlock:(void ( ^ ) ( NSError *error ))block

Parameters

token

application’s deviceToken

block

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

Discussion

Unregisters device in the background thread

Declared In

NetmeraPushService.h

registerWithNetmeraDeviceDetail:

Register any device from any groups.

+ (void)registerWithNetmeraDeviceDetail:(NetmeraDeviceDetail *)deviceDetail

Parameters

deviceDetail

token and deviceGroupList attributes of NetmeraDeviceDetail instance that you created must not be nil.

Discussion

Register any device from any groups.

Declared In

NetmeraPushService.h

registerWithToken:

Registers the device into to the server.

+ (void)registerWithToken:(NSString *)token

Parameters

token

application’s deviceToken

Discussion

Registers the device into to the server.

Declared In

NetmeraPushService.h

sendNotificationInBackgroundWithBlock:withMessage:withDeviceGroups:isSendToIOS:isSendToAndroid:withError:

Sends notification to IOs and Android devices in backgroud thread.

+ (void)sendNotificationInBackgroundWithBlock:(void ( ^ ) ( NSError *error , NSMutableDictionary *pushInfoList ))block withMessage:(NSString *)message withDeviceGroups:(NSArray *)deviceGroups isSendToIOS:(BOOL)isSendToIOS isSendToAndroid:(BOOL)isSendToAndroid withError:(NSError **)error

Parameters

block

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

message

Body text of push notification

deviceGroups

Names of your target group

isSendToIOS

BOOL parameter if you want to send your push notification to IOs devices

isSendToAndroid

BOOL parameter if you want to send your push notification to Android devices

Discussion

Sends notification to IOs and Android devices in backgroud thread.

Declared In

NetmeraPushService.h

sendNotificationInBackgroundWithMessage:

Sends notification to IOs and Android devices in backgroud thread.

+ (void)sendNotificationInBackgroundWithMessage:(NSString *)message

Parameters

message

Body text of push notification

Discussion

Sends notification to IOs and Android devices in backgroud thread.

Declared In

NetmeraPushService.h

sendNotificationInBackgroundWithMessage:withDeviceGroups:isSendToIOS:isSendToAndroid:

Sends notification to IOs and Android devices in backgroud thread.

+ (void)sendNotificationInBackgroundWithMessage:(NSString *)message withDeviceGroups:(NSArray *)deviceGroups isSendToIOS:(BOOL)isSendToIOS isSendToAndroid:(BOOL)isSendToAndroid

Parameters

message

Body text of push notification

deviceGroups

Names of your target group

isSendToIOS

BOOL parameter if you want to send your push notification to IOs devices

isSendToAndroid

BOOL parameter if you want to send your push notification to Android devices

Discussion

Sends notification to IOs and Android devices in backgroud thread.

Declared In

NetmeraPushService.h

sendNotificationWithMessage:withDeviceGroups:isSendToIOS:isSendToAndroid:withError:

Sends notification to IOs and Android devices.

+ (NSMutableDictionary *)sendNotificationWithMessage:(NSString *)message withDeviceGroups:(NSArray *)deviceGroups isSendToIOS:(BOOL)isSendToIOS isSendToAndroid:(BOOL)isSendToAndroid withError:(NSError **)error

Parameters

message

Body text of push notification

deviceGroups

Names of your target group

isSendToIOS

BOOL parameter if you want to send your push notification to IOs devices

isSendToAndroid

BOOL parameter if you want to send your push notification to Android devices

error

if it cannot access server

Return Value

NSMutableDictionary include max. two NetmeraPushInfo object with keys “IOS” and “Android”

Discussion

Sends notification to IOs and Android devices.

Declared In

NetmeraPushService.h

sendNotificationWithMessage:withDeviceGroups:withError:

Sends notification to IOs and Android devices.

+ (NSMutableDictionary *)sendNotificationWithMessage:(NSString *)message withDeviceGroups:(NSArray *)deviceGroups withError:(NSError **)error

Parameters

message

Body text of push notification

deviceGroups

Names of your target group

error

if it cannot access server

Return Value

NSMutableDictionary include max. two NetmeraPushInfo object with keys “IOS” and “Android”

Discussion

Sends notification to IOs and Android devices.

Declared In

NetmeraPushService.h

sendNotificationWithMessage:withError:

Sends notification to IOs and Android devices.

+ (NSMutableDictionary *)sendNotificationWithMessage:(NSString *)message withError:(NSError **)error

Parameters

message

Body text of push notification

error

if it cannot access server

Return Value

NSMutableDictionary include max. two NetmeraPushInfo object with keys “IOS” and “Android”

Discussion

Sends notification to IOs and Android devices.

Declared In

NetmeraPushService.h

unRegisterInBackgroundWithNetmeraDeviceDetail:

Unregister any device from any groups in background thread.

+ (void)unRegisterInBackgroundWithNetmeraDeviceDetail:(NetmeraDeviceDetail *)deviceDetail

Parameters

deviceDetail

token and deviceGroupList attributes of NetmeraDeviceDetail instance that you created must not be nil.

Discussion

Unregister any device from any groups in background thread.

Declared In

NetmeraPushService.h

unRegisterInBackgroundWithToken:

Unregisters device in the background thread and not callback any

+ (void)unRegisterInBackgroundWithToken:(NSString *)token

Parameters

token

application’s deviceToken

Discussion

Unregisters device in the background thread and not callback any

Declared In

NetmeraPushService.h

unRegisterInBackgroundWithToken:withBlock:

Unregisters device in the background thread

+ (void)unRegisterInBackgroundWithToken:(NSString *)token withBlock:(void ( ^ ) ( NSError *error ))block

Parameters

token

application’s deviceToken

block

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

Discussion

Unregisters device in the background thread

Declared In

NetmeraPushService.h

unRegisterWithNetmeraDeviceDetail:

Unregister any device from any groups.

+ (void)unRegisterWithNetmeraDeviceDetail:(NetmeraDeviceDetail *)deviceDetail

Parameters

deviceDetail

token and deviceGroupList attributes of NetmeraDeviceDetail instance that you created must not be nil.

Discussion

Unregister any device from any groups.

Declared In

NetmeraPushService.h

unRegisterWithToken:

Unregisters device.

+ (void)unRegisterWithToken:(NSString *)token

Parameters

token

application’s deviceToken

Discussion

Unregisters device.

Declared In

NetmeraPushService.h