Inherits from NMPushObject : NSObject
Declared in NMPushSenderObject.h
NMPushSenderObject.m

Overview

NMPushSenderObject class is used to send plain-text push notification to the devices with certain properties. By using this class, different properties that serve your needs of the push notification can be set. By default, you have to set ‘Title’ and ‘Alert Text’ properties. Other properties are optional. Just if ‘Token’ property is set, ‘Tags’ and ‘Platforms’ properties will be ignored. In Netmera Push Backend Service, token has higher priority. ‘Location Info’ and ‘Platform’ properties are readonly, however, these properties can be set via setPushCircleLocationInfoWithCenterLocation:distance:, setPushBoxLocationInfoWithFirstLocation:secondLocation: and setTargetPushPlatform: methods in order to prevent to send invalid values.

Tasks

  •   title

    Title of the push notification object. This property is required.

    property
  •   locationInfo

    Location information, of which the area where the push notification is sent. It contains push type and relevant geo-locations. This property is optional.

    property
  •   token

    Token of the device, which will be requested to send the push notification. This property is optional.

    property
  •   tags

    Tags of the devices, which will receive the sending the push notification. If not set, then the push notification is sent to all devices(Default Tag: BROADCAST). This property is optional.

    property
  •   platforms

    Platforms of the devices, which will be receive the sending push notification. By default, the push notification is sent to device of all platforms. This property is read-only.

    property
  • – setPushCircleLocationInfoWithCenterLocation:distance:

    Sets location info with ‘Circle’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

  • – setPushBoxLocationInfoWithFirstLocation:secondLocation:

    Sets location info with ‘Box’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

  • – setPushPlatform:

    Sets the platforms of the devices, which will be intended to send the push notification.

  • – initWithTitle:alertText:

    Initializes the newly allocated NMPushSenderObject with the specified title and alert text values of push notification.

  • – whereEqualWithCustomField:value:

    Key-value pair as given parameter is used to filter the device(s) that will receive push notifications over the value of customDictionary of NMDeviceDetail object while registering to NMPushManager.

  • – sendPushNotificationWithCompletionHandler:

    Sends the push notification on the background thread.

Properties

locationInfo

Location information, of which the area where the push notification is sent. It contains push type and relevant geo-locations. This property is optional.

@property (nonatomic, readonly, strong) NSDictionary *locationInfo

Discussion

Location information, of which the area where the push notification is sent. It contains push type and relevant geo-locations. This property is optional.

Declared In

NMPushSenderObject.h

platforms

Platforms of the devices, which will be receive the sending push notification. By default, the push notification is sent to device of all platforms. This property is read-only.

@property (nonatomic, readonly, strong) NSArray *platforms

Discussion

Platforms of the devices, which will be receive the sending push notification. By default, the push notification is sent to device of all platforms. This property is read-only.

Declared In

NMPushSenderObject.h

tags

Tags of the devices, which will receive the sending the push notification. If not set, then the push notification is sent to all devices(Default Tag: BROADCAST). This property is optional.

@property (nonatomic, strong) NSMutableArray *tags

Discussion

Tags of the devices, which will receive the sending the push notification. If not set, then the push notification is sent to all devices(Default Tag: BROADCAST). This property is optional.

Declared In

NMPushSenderObject.h

title

Title of the push notification object. This property is required.

@property (nonatomic, strong) NSString *title

Discussion

Title of the push notification object. This property is required.

Declared In

NMPushSenderObject.h

token

Token of the device, which will be requested to send the push notification. This property is optional.

@property (nonatomic, strong) NSString *token

Discussion

Token of the device, which will be requested to send the push notification. This property is optional.

Declared In

NMPushSenderObject.h

Instance Methods

initWithTitle:alertText:

Initializes the newly allocated NMPushSenderObject with the specified title and alert text values of push notification.

- (id)initWithTitle:(NSString *)title alertText:(NSString *)text

Parameters

title

Title of the push notification.

text

Message of the push notification.

Return Value

An initialized NMPushSenderObject object with given parameters.

Discussion

Initializes the newly allocated NMPushSenderObject with the specified title and alert text values of push notification.

Declared In

NMPushSenderObject.h

sendPushNotificationWithCompletionHandler:

Sends the push notification on the background thread.

- (void)sendPushNotificationWithCompletionHandler:(void ( ^ ) ( NSString *notificationId , NSError *error ))handler

Parameters

handler

The block to execute when the sending push notification is completed.

Discussion

Sends the push notification on the background thread.

Declared In

NMPushSenderObject.h

setPushBoxLocationInfoWithFirstLocation:secondLocation:

Sets location info with ‘Box’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

- (void)setPushBoxLocationInfoWithFirstLocation:(NMGeolocation *)firstLocation secondLocation:(NMGeolocation *)secondLocation

Parameters

firstLocation

One of the corners of the box area.

secondLocation

Diagonal corner of the first location of the box area.

Discussion

Sets location info with ‘Box’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

Declared In

NMPushSenderObject.h

setPushCircleLocationInfoWithCenterLocation:distance:

Sets location info with ‘Circle’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

- (void)setPushCircleLocationInfoWithCenterLocation:(NMGeolocation *)location distance:(double)distance

Parameters

location

Center location of the circle area.

distance

Radius of the circle area.

Discussion

Sets location info with ‘Circle’ type. This set-up enables the devices only-located inside the given area to receive sending push notification.

Declared In

NMPushSenderObject.h

setPushPlatform:

Sets the platforms of the devices, which will be intended to send the push notification.

- (void)setPushPlatform:(NMPushPlatform)platforms

Parameters

platforms

Corresponding enum values of the platforms. You can set multiple platforms by put OR(|) operator between enum values.

Discussion

Sets the platforms of the devices, which will be intended to send the push notification.

Warning: Available enum PushPlatform options.

PushPlatformIOS, ‘IOS’ platform.

PushPlatformAndroid, ‘Android’ platform.

PushPlatformWp, ‘Windows Phone’ platform.

Declared In

NMPushSenderObject.h

whereEqualWithCustomField:value:

Key-value pair as given parameter is used to filter the device(s) that will receive push notifications over the value of customDictionary of NMDeviceDetail object while registering to NMPushManager.

- (NMPushSenderObject *)whereEqualWithCustomField:(NSString *)key value:(id)value

Parameters

key

Key value for filtering the registered pairs.

value

Object value for filtering the registered pairs.

Return Value

Receiver NMPushSenderObject object.

Discussion

Key-value pair as given parameter is used to filter the device(s) that will receive push notifications over the value of customDictionary of NMDeviceDetail object while registering to NMPushManager.

Multiple key-value pairs can be set while sending push notifications using this method. Therefore, push notification will be sent to the device(s) that contain all key-value pairs.

Declared In

NMPushSenderObject.h