Inherits from NSObject
Declared in NMDeviceDetail.h
NMDeviceDetail.m

Overview

NMDeviceDetail class is used to get the information of the device registered to push notification service of Netmera. Therefore, tags, location or custom key-value pairs of the registered device can be accessed easily. Moreover, these fields must be first set on the NMDeviceDetail object and then the device can be registered to ‘Netmera Push Service’ with these properties

Tasks

  •   location

    Location of the registered device.

    property
  •   customDictionary

    Custom key-value pairs that can be used to specify the device. Default value is nil. If this value is nil when calling +registerWithDeviceDetail:completionHandler: method, existing customDictionary does not overridden. Else, existing customDictionary value is overridden with given dictionary.

    property
  • – deviceToken

    Returns the deviceToken received from APNS (Apple Push Notification Service) while registering the device. This value is hold automatically by Netmera SDK and provide the uniqueness of the device for push notifications.

  • – getTags

    Returns the tags that are set to the NMDeviceDetail object via addTag: , addTags: or overrideTagsWithNewTags: method. It DOES NOT return actual tags of the device. In order to get actual tags registered by device, use getDeviceDetailWithCompletionHandler: method.

  • – overrideTagsWithNewTags:

    Overrides the current tags of the device registered to ‘Netmera Push Service’ with the given tag collection.

  • – addTag:

    Adds a tag into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag.

  • – addTags:

    Adds multiple tags into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag array.

  • + getDeviceDetailWithCompletionHandler:

    Fetches the detail of the device registered to ‘Netmera Push Service’ asynchronously.

Properties

customDictionary

Custom key-value pairs that can be used to specify the device. Default value is nil. If this value is nil when calling +registerWithDeviceDetail:completionHandler: method, existing customDictionary does not overridden. Else, existing customDictionary value is overridden with given dictionary.

@property (nonatomic, strong) NSMutableDictionary *customDictionary

Discussion

Custom key-value pairs that can be used to specify the device. Default value is nil. If this value is nil when calling +registerWithDeviceDetail:completionHandler: method, existing customDictionary does not overridden. Else, existing customDictionary value is overridden with given dictionary.

Declared In

NMDeviceDetail.h

location

Location of the registered device.

@property (nonatomic, strong) NMGeolocation *location

Discussion

Location of the registered device.

This value refers to the last location of the device that can be stored in Netmera.

Declared In

NMDeviceDetail.h

Class Methods

getDeviceDetailWithCompletionHandler:

Fetches the detail of the device registered to ‘Netmera Push Service’ asynchronously.

+ (void)getDeviceDetailWithCompletionHandler:(void ( ^ ) ( NMDeviceDetail *deviceDetail , NSError *error ))handler

Parameters

handler

The block to execute when the fetch of the device detail is completed.

Discussion

Fetches the detail of the device registered to ‘Netmera Push Service’ asynchronously.

Declared In

NMDeviceDetail.h

Instance Methods

addTag:

Adds a tag into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag.

- (void)addTag:(NSString *)tag

Parameters

tag

Tag which is used to register/unregister the device to/from ‘Netmera Push Service’.

Discussion

Adds a tag into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag.

This method does not register to or unregister from ‘Netmera Push Service’ for the given tag automatically. You should call registerWithDeviceDetail:completionHandler: or unregisterWithDeviceDetail:completionHandler: method of NMPushManager with the receiver NMDeviceDetail object.

Declared In

NMDeviceDetail.h

addTags:

Adds multiple tags into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag array.

- (void)addTags:(NSArray *)tags

Parameters

tags

Array of the tags which are used to register/unregister the device to/from ‘Netmera Push Service’.

Discussion

Adds multiple tags into the receiver NMDeviceDetail object. Using the receiver object, the device can be registered to or unregistered from ‘Netmera Push Service’ for the given tag array.

This method does not register to or unregister from ‘Netmera Push Service’ for the given tags automatically. You should call registerWithDeviceDetail:completionHandler: or unregisterWithDeviceDetail:completionHandler: method of NMPushManager with the receiver NMDeviceDetail object.

Declared In

NMDeviceDetail.h

deviceToken

Returns the deviceToken received from APNS (Apple Push Notification Service) while registering the device. This value is hold automatically by Netmera SDK and provide the uniqueness of the device for push notifications.

- (NSString *)deviceToken

Return Value

Token of the device retrieved from application:didRegisterForRemoteNotificationsWithDeviceToken: delegate method.

Discussion

Returns the deviceToken received from APNS (Apple Push Notification Service) while registering the device. This value is hold automatically by Netmera SDK and provide the uniqueness of the device for push notifications.

Declared In

NMDeviceDetail.h

getTags

Returns the tags that are set to the NMDeviceDetail object via addTag: , addTags: or overrideTagsWithNewTags: method. It DOES NOT return actual tags of the device. In order to get actual tags registered by device, use getDeviceDetailWithCompletionHandler: method.

- (NSArray *)getTags

Discussion

Returns the tags that are set to the NMDeviceDetail object via addTag: , addTags: or overrideTagsWithNewTags: method. It DOES NOT return actual tags of the device. In order to get actual tags registered by device, use getDeviceDetailWithCompletionHandler: method.

Declared In

NMDeviceDetail.h

overrideTagsWithNewTags:

Overrides the current tags of the device registered to ‘Netmera Push Service’ with the given tag collection.

- (void)overrideTagsWithNewTags:(NSArray *)tags

Parameters

tags

Array of the tags which overrides the current ones of the device.

Discussion

Overrides the current tags of the device registered to ‘Netmera Push Service’ with the given tag collection.

This method should be called carefully, because once the current tags of the device is overridden, there is no turning back to old tags. This method does not register the given tags to ‘Netmera Push Service’ automatically. You should call registerWithDeviceDetail:completionHandler: method of NMPushManager with the receiver NMDeviceDetail object.

Declared In

NMDeviceDetail.h