KiiReceivedMessage Class Reference
Inherits from | NSObject |
Declared in | KiiReceivedMessage.h |
Overview
Class for encapsulating incoming push notification message Three types of push message supported by KiiCloud.
- Push to App : Message sent to the subscribers when an event happens in the KiiBucket.
- Push to User : Message sent to the subscribers of KiiTopic that is created explicitly.
- Direct Push : Message sent to a certain user by manipulating the developer portal. (Only app developer can send this message.)
Following section describes the contents of “Push to App”, “Push to User” and “Direct Push” message.
Contents of Push Message
Push message of “Push to App”, “Push to User” and “Direct Push” contains the KiiCloud specific fields that are selected by the message sender. And also push message of “Push to User” contains the basic message as key-value pair that is sent to the KiiTopic.
KiiCloud specific fields are as follows:
Key | Short key | Push to App | Push to User | Direct Push | Description | Possible values |
---|---|---|---|---|---|---|
KiiMessage_APP_ID | a | - | - (Depends on “sendAppID”) |
- | Source app which generated the notification. | |
KiiMessage_SENDER | s | - | X (Depends on “sendSender”) |
X (Depends on “sendSender”) |
The user or thing who caused the notification. | |
KiiMessage_ORIGIN | o | - | - (Depends on “sendOrigin”) |
- (Depends on “sendOrigin”) |
Origin of push. “EVENT” for “Push to App” notification. “EXPLICIT” for “Push to User” notification. | - EVENT - EXPLICIT |
KiiMessage_WHEN | w | X | - (Depends on “sendWhen”) |
- (Depends on “sendWhen”) |
The timestamp of the notification in milliseconds. (Since January 1, 1970 00:00:00 UTC) | |
KiiMessage_TYPE | t | X | - (Depends on “pushMessageType”) |
- (Depends on “pushMessageType”) |
The type of notification and the additional data. | [Push to App] - DATA_OBJECT_CREATED - DATA_OBJECT_DELETED - DATA_OBJECT_UPDATED - DATA_OBJECT_BODY_UPDATED - DATA_OBJECT_BODY_DELETED - DATA_OBJECT_ACL_MODIFIED - BUCKET_DELETED |
KiiMessage_TOPIC | to | - | X (Depends on “sendTopicID”) |
- | TopicID is only for “Push to User” push messages. | |
KiiMessage_SCOPE_APP_ID | sa | X | X (Depends on “sendObjectScope”) |
- | AppID of topic/object scope. | |
KiiMessage_SCOPE_USER_ID | su | X | X (Depends on “sendObjectScope”) |
- | UserID of topic/object scope. Push message has this field only if the subscribed bucket/topic is user scope. | |
KiiMessage_SCOPE_GROUP_ID | sg | X | X (Depends on “sendObjectScope”) |
- | GroupID of topic/object scope. Push message has this field only if the subscribed bucket/topic is group scope. | |
KiiMessage_SCOPE_THING_ID | sth | X | X (Depends on “sendObjectScope”) |
- | ThingID of topic/object scope. Push message has this field only if the subscribed bucket/topic is thing scope. | |
KiiMessage_SCOPE_TYPE | st | X | X (Depends on “sendObjectScope”) |
- | Type of topic/object scope. | - APP - APP_AND_USER - APP_AND_GROUP - APP_AND_THING |
KiiMessage_BUCKET_ID | bi | X | - | - | Bucket name of push subscribed. | |
KiiMessage_BUCKET_TYPE | bt | X | - | - | Type of bucket has been modified. | - rw - sync |
KiiMessage_OBJECT_ID | oi | X | - | - | ID of the object operated. | |
KiiMessage_OBJECT_MODIFIED_AT | om | - | - | - | Timestamp of the modification of object in milliseconds. (Since January 1, 1970 00:00:00 UTC) | - DATA_OBJECT_CREATED - DATA_OBJECT_UPDATED - DATA_OBJECT_BODY_UPDATE |
Tasks
-
rawMessage
property -
+ messageFromAPNS:
-
– getValueOfKiiMessageField:
-
– getAlertBody
-
– showMessageAlertWithTitle:
-
– eventSourceBucket
-
– eventSourceObject
-
– eventSourceTopic
-
– eventSourceUser
-
– eventSourceThing
-
– eventSourceGroup
-
– senderUser
-
– senderThing
-
– containsKiiBucket
-
– containsKiiObject
-
– containsKiiTopic
-
– messageScope
Class Methods
messageFromAPNS:
Parse incoming APNs message.
+ (instancetype)messageFromAPNS:(NSDictionary *)userInfo
Parameters
- userInfo
An userInfo instance that received from APNs as a push message.
Return Value
A KiiPushMessage instance that is associated to the userInfo.
Discussion
Parse incoming APNs message.
Declared In
KiiReceivedMessage.h
Instance Methods
containsKiiBucket
- Checks whether the push message contains KiiBucket or not.
- (BOOL)containsKiiBucket
Return Value
YES if the push message contains KiiBucket, otherwise NO. *
Discussion
- Checks whether the push message contains KiiBucket or not.
Declared In
KiiReceivedMessage.h
containsKiiObject
- Checks whether the push message contains KiiObject or not.
- (BOOL)containsKiiObject
Return Value
YES if the push message contains KiiObject, otherwise NO.
Discussion
- Checks whether the push message contains KiiObject or not.
Declared In
KiiReceivedMessage.h
containsKiiTopic
- Checks whether the push message contains KiiTopic or not.
- (BOOL)containsKiiTopic
Return Value
YES if the push message contains KiiTopic, otherwise NO.
Discussion
- Checks whether the push message contains KiiTopic or not.
Declared In
KiiReceivedMessage.h
eventSourceBucket
Obtain KiiBucket based on the information parsed from push message.
- (nullable KiiBucket *)eventSourceBucket
Return Value
KiiBucket instance when the event of KiiBucket or KiiObject inside KiiBucket happened. In other cases returns nil.
Discussion
Obtain KiiBucket based on the information parsed from push message.
The payloads can contain the subscribed bucket informations including the scope and the type (encrypted or not). This API provides convenience methods to obtain KiiBucket if the payload contains the subscribed bucket information.
Declared In
KiiReceivedMessage.h
eventSourceGroup
Obtain KiiGroup based on the information parsed from push message scope.
- (nullable KiiGroup *)eventSourceGroup
Return Value
KiiGroup instance when the subscribed bucket/topic is group scope. In other cases returns nil.
Discussion
Obtain KiiGroup based on the information parsed from push message scope.
The payloads can contain the subscribed bucket/topic informations including the scope. This API provides convenience methods to obtain KiiGroup if the payload contains group scoped bucket/topic information.
Declared In
KiiReceivedMessage.h
eventSourceObject
Obtain KiiObject based on the information parsed from push message.
- (nullable KiiObject *)eventSourceObject
Return Value
KiiObject instance when the event of KiiObject * inside KiiBucket happened. In other cases returns nil.
Discussion
Obtain KiiObject based on the information parsed from push message.
The payloads can contain the subscribed bucket’s object informations including the scope. This API provides convenience methods to obtain KiiObject if the payload contains the object information.
Declared In
KiiReceivedMessage.h
eventSourceThing
Obtain KiiThing based on the information parsed from push message.
- (nullable KiiThing *)eventSourceThing
Return Value
KiiThing instance when the subscribed bucket/topic is thing scope. In other cases returns nil.
Discussion
Obtain KiiThing based on the information parsed from push message.
The payloads can contain the subscribed bucket/topic informations including the scope. This API provides convenience methods to obtain KiiThing if the payload contains thing scoped bucket/topic information.
Declared In
KiiReceivedMessage.h
eventSourceTopic
Obtain KiiTopic based on the information parsed from push message.
- (nullable KiiTopic *)eventSourceTopic
Return Value
KiiTopic instance when the event of KiiTopic (Push to User). In other cases returns nil.
Discussion
Obtain KiiTopic based on the information parsed from push message.
The payloads can contain the subscribed topic informations including the scope. This API provides convenience methods to obtain KiiTopic if the payload contains the subscribed topic information.
Declared In
KiiReceivedMessage.h
eventSourceUser
Obtain KiiUser based on the information parsed from push message.
- (nullable KiiUser *)eventSourceUser
Return Value
KiiUser instance when the subscribed bucket/topic is user scope. In other cases returns nil.
Discussion
Obtain KiiUser based on the information parsed from push message.
The payloads can contain the subscribed bucket/topic informations including the scope. This API provides convenience methods to obtain KiiUser if the payload contains user scoped bucket/topic information.
Declared In
KiiReceivedMessage.h
getAlertBody
Get alert body’s text message.
- (nullable NSString *)getAlertBody
Return Value
A NSString object of alert body text message.
Discussion
Get alert body’s text message.
Declared In
KiiReceivedMessage.h
getValueOfKiiMessageField:
Get specific value of received message meta data.
- (nullable NSString *)getValueOfKiiMessageField:(KiiMessageField)field
Parameters
- field
Enumeration of KiiMessageField.
Return Value
A NSString object that is associated to the message fields.
Discussion
Get specific value of received message meta data.
Declared In
KiiReceivedMessage.h
messageScope
Obtain scope of the bucket/topic.
- (KiiMessageScope)messageScope
Return Value
enumeration of message scope. If not provided, it will return KiiMessageScope_UNKNOWN;
Discussion
Obtain scope of the bucket/topic.
Declared In
KiiReceivedMessage.h
senderThing
Obtain KiiThing based on the information parsed from push message.
- (nullable KiiThing *)senderThing
Return Value
KiiThing instance when the sender of the message is a KiiThing. In other cases returns nil.
Discussion
Obtain KiiThing based on the information parsed from push message.
Declared In
KiiReceivedMessage.h
senderUser
Obtain KiiUser based on the information parsed from push message .
- (nullable KiiUser *)senderUser
Return Value
KiiUser instance when the sender of the message is a KiiUser. In other cases returns nil.
Discussion
Obtain KiiUser based on the information parsed from push message .
Declared In
KiiReceivedMessage.h