Class Index | File Index

Classes


Class KiiPushMessageBuilder

Builder of push message
Defined in: KiiSDK.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
apnsAlert(alert)
Set alert for APNS subscribers.
 
apnsBadge(badge)
Set badge for APNS subscribers.
 
apnsCategory(category)
Set category for APNS subscribers.
 
apnsContentAvailable(contentAvailable)
Set content-available for APNS subscribers.
 
apnsData(data)
Set specific data for APNS subscribers.
 
apnsMutableContent(mutableContent)
Set mutable-content for APNS subscribers.
 
apnsSound(sound)
Set sound for APNS subscribers.
 
build push message.
 
enableApns(enable)
Enable/ Disable message distribution via APNS.
 
enableGcm(enable)
Enable/ Disable message distribution via GCM.
 
enableJpush(enable)
Enable/ Disable message distribution via JPush.
 
enableMqtt(enable)
Enable/ Disable message distribution via MQTT.
 
gcmCollapseKey(collapseKey)
Set collapse_key for GCM subscribers.
 
gcmData(data)
Set specific data for GCM subscribers.
 
gcmDelayWhileIdle(delayWhileIdle)
Set delay_while_idle for GCM subscribers.
 
Set restricted_package_name for GCM subscribers.
 
gcmTimeToLive(timeToLive)
Set time_to_live for GCM subscribers.
 
jpushData(data)
Set specific data for JPush subscribers.
<inner>  
instantiate builder with push message data.
 
mqttData(data)
Set specific data for MQTT subscribers.
 
Indicate whether send this message to development environment.
 
Indicate whether send this message to production environment.
Class Detail
KiiPushMessageBuilder()
Method Detail
{Object} apnsAlert(alert)
Set alert for APNS subscribers. If this method is not called, no alert is applied. For details please refer to APNS document of alert.
Parameters:
{Object} alert
alert object
Returns:
{Object} builder instance.

{Object} apnsBadge(badge)
Set badge for APNS subscribers. If this method is not called, no badge is applied. For details please refer to APNS document of badge.
Parameters:
{Number} badge
Returns:
{Object} builder instance.

{Object} apnsCategory(category)
Set category for APNS subscribers. If this method is not called, no category is applied. For details please refer to APNS document of category.
Parameters:
{String} category
Returns:
{Object} builder instance.

{Object} apnsContentAvailable(contentAvailable)
Set content-available for APNS subscribers. If this method is not called, no content-available is applied.
Parameters:
{Number} contentAvailable
If eqaul or less than 0 or this method is not invoked, content-available payload is not delivered. Otherwise, content-available=1 payload is delivered.
Returns:
{Object} builder instance.

{Object} apnsData(data)
Set specific data for APNS subscribers. If this method is not called, no specific data is not applied and data passed to the constructor would be sent to subscribers.
Parameters:
{Object} data
specific data applied to only APNS subscribers. Contents should be JSON Object with only one-level of nesting, and only strings, integers, booleans or doubles in the values.
Returns:
{Object} builder instance.

{Object} apnsMutableContent(mutableContent)
Set mutable-content for APNS subscribers. If this method is not called, no mutable-content is applied.
Parameters:
{Number} mutableContent
If equal or less than 0 or this method is not invoked, mutable-content payload is not delivered. Otherwise, mutable-content=1 payload is delivered.
Returns:
{Object} builder instance.

{Object} apnsSound(sound)
Set sound for APNS subscribers. If this method is not called, no sound is applied. For details please refer to APNS document of sound.
Parameters:
{String} sound
Returns:
{Object} builder instance.

{Object} build()
build push message.
Returns:
{Object} push message object. Can be used in KiiTopic#sendMessage()

{Object} enableApns(enable)
Enable/ Disable message distribution via APNS. If this method is not called, true will be applied as default.
Parameters:
{boolean} enable
flag indicate whether distribute this message to APNS subscribers.
Returns:
{Object} builder instance.

{Object} enableGcm(enable)
Enable/ Disable message distribution via GCM. If this method is not called, true will be applied as default.
Parameters:
{boolean} enable
flag indicate whether distribute this message to GCM subscribers.
Returns:
{Object} builder instance.

{Object} enableJpush(enable)
Enable/ Disable message distribution via JPush. If this method is not called, true will be applied as default.
Parameters:
{boolean} enable
flag indicate whether distribute this message to JPush subscribers.
Returns:
{Object} builder instance.

{Object} enableMqtt(enable)
Enable/ Disable message distribution via MQTT. If this method is not called, true will be applied as default.
Parameters:
{boolean} enable
flag indicate whether distribute this message to MQTT subscribers.
Returns:
{Object} builder instance.

{Object} gcmCollapseKey(collapseKey)
Set collapse_key for GCM subscribers. If this method is not called, no collapse_key is applied. For details please refer to GCM document of collapse_key.
Parameters:
{String} collapseKey
Returns:
{Object} builder instance.

{Object} gcmData(data)
Set specific data for GCM subscribers. If this method is not called, no specific data is not applied and data passed to the constructor would be sent to subscribers.
Parameters:
{Object} data
specific data applied to only GCM subscribers. Contents should be JSON Object with only one-level of nesting, and only strings in values
Returns:
{Object} builder instance.

{Object} gcmDelayWhileIdle(delayWhileIdle)
Set delay_while_idle for GCM subscribers. If this method is not called, no delay_while_idle is applied. For details please refer to GCM document of delay_while_idle.
Parameters:
{boolean} delayWhileIdle
Returns:
{Object} builder instance.

{Object} gcmRestrictedPackageName()
Set restricted_package_name for GCM subscribers. If this method is not called, no restricted_package_name is applied. For details please refer to GCM document of restricted_package_name.
Parameters:
{String} restrictedPackageName.
Returns:
{Object} builder instance.

{Object} gcmTimeToLive(timeToLive)
Set time_to_live for GCM subscribers. If this method is not called, no time_to_live is applied. For details please refer to GCM document of time_to_live.
Parameters:
{Number} timeToLive
Returns:
{Object} builder instance.

{Object} jpushData(data)
Set specific data for JPush subscribers. If this method is not called, no specific data is not applied and data passed to the constructor would be sent to subscribers.
Parameters:
{Object} data
specific data applied to only JPush subscribers. Contents should be JSON Object with only one-level of nesting, and only strings, integers, booleans or doubles in the values.
Returns:
{Object} builder instance.

<inner> KiiPushMessageBuilder(data)
instantiate builder with push message data. By default all push channels (gcm, apns, jpush, mqtt) is enabled. All other properties configured by method of this class won't be set and default value would be applied.
Details of properties of message and its default value, please refer to http://documentation.kii.com/rest/#notification_management-leverage__push_to_users__notification-group_scope-send_messages-send_a_push_message_to_the_current_topic
Parameters:
{Object} data
sent to all push channels (gcm, apns, jpush, mqtt).

{Object} mqttData(data)
Set specific data for MQTT subscribers. If this method is not called, no specific data is not applied and data passed to the constructor would be sent to subscribers.
Parameters:
{Object} data
specific data applied to only MQTT subscribers. Contents should be JSON Object with only one-level of nesting, and only strings in the values.
Returns:
{Object} builder instance.

setSendToDevelopment(flag)
Indicate whether send this message to development environment. If this method is not called, true will be applied as default.
Parameters:
{boolean} flag
indicate whether send this message to development env.
Returns:
builder instance.

{Object} setSendToProduction(flag)
Indicate whether send this message to production environment. If this method is not called, true will be applied as default.
Parameters:
{boolean} flag
indicate whether send this message to production env.
Returns:
{Object} builder instance.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Sep 15 2021 05:31:33 GMT-0000 (UTC)