NMPushSenderObject Class Reference
| 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
-
titleTitle of the push notification object. This property is required.
property -
locationInfoLocation information, of which the area where the push notification is sent. It contains push type and relevant geo-locations. This property is optional.
property -
tokenToken of the device, which will be requested to send the push notification. This property is optional.
property -
tagsTags 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 -
platformsPlatforms 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 *locationInfoDiscussion
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.hplatforms
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 *platformsDiscussion
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.htags
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 *tagsDiscussion
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.htitle
Title of the push notification object. This property is required.
@property (nonatomic, strong) NSString *titleDiscussion
Title of the push notification object. This property is required.
Declared In
NMPushSenderObject.htoken
Token of the device, which will be requested to send the push notification. This property is optional.
@property (nonatomic, strong) NSString *tokenDiscussion
Token of the device, which will be requested to send the push notification. This property is optional.
Declared In
NMPushSenderObject.hInstance 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 *)textParameters
- 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.hsendPushNotificationWithCompletionHandler:
Sends the push notification on the background thread.
- (void)sendPushNotificationWithCompletionHandler:(void ( ^ ) ( NSString *notificationId , NSError *error ))handlerParameters
- handler
The block to execute when the sending push notification is completed.
Discussion
Sends the push notification on the background thread.
Declared In
NMPushSenderObject.hsetPushBoxLocationInfoWithFirstLocation: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 *)secondLocationParameters
- 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.hsetPushCircleLocationInfoWithCenterLocation: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)distanceParameters
- 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.hsetPushPlatform:
Sets the platforms of the devices, which will be intended to send the push notification.
- (void)setPushPlatform:(NMPushPlatform)platformsParameters
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.hwhereEqualWithCustomField: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)valueParameters
- 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