Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titlePush Notification Callback and Extra Fields Parsing

The method handleIncomingPushMessage() id the method that will be called every time a push notification will be received by the device. Further explanation on using the Incoming Push Notification Callback Method can be found here.

 


Alias

Set device alias.

/**
* Set device's alias - a unique identifier tor this device
* @param value alias
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setDeviceAlias(value:String,func:Function):void

 


Code Block
languagejs
titleExample
private function handleSetAliasCallback(result:String):void	{
	//Do something with result (true/false as string)
} 
...
function setDeviceAlias(alias:String):void {
    _appoxeeANE.setDeviceAlias(alias,handleSetAliasCallback);	
}

...


Get device alias.

/**
* Get device's alias
* @param func callback function to get result (expected : the alias , Empty String (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function getDeviceAlias(func:Function):void

Code Block
languagejs
titleExample
private function getAliasCallback(result:String):void {
	//Do something with result (the alias itself)
}
... 
function getAlias():void {
    _appoxeeANE.getDeviceAlias(getAliasCallback);
}

 


Remove Alias

/**
* Remove device's alias
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function removeDeviceAlias(func:Function):void

Code Block
languagejs
titleExample
private function handleRemoveAliasCallback(result:String):void {
	//Do something with result (true/false as string)
} 
 
function removeDeviceAlias():void {
   	_appoxeeANE.removeDeviceAlias(handleRemoveAliasCallback);
}

...


Device API 

Device Information

...

Warning

Inbox / In-App messages / Rich Messages API is not supported in Android

...


Rich Messages


Info

Available only for Appoxee standalone customers (Not available for DMC customers)


/**
* Get the list of messages [note: not available for Android]
* @param func callback function to get result (expected : json payload as string , representing the rich messages)
*/
public function getRichMessages(func:Function):void

Code Block
languagejs
titleExample
private function handleGetRichMessagesCallback(result:String):void {
	//Result is string representation of the rich messages
} 
...
function getRichMessages():void {
    _appoxeeANE.getRichMessages(handleGetRichMessagesCallback);
}

...



Delete Messages

/**
* Delete inbox message [note: not available for Android]
* @param messageID id of the message to delete
* @param func callback function to get result (expected : "true" when the operation is successful)
*/
public function deleteRichMessage(messageId:int,func:Function):void

Code Block
languagejs
titleExample
private function handleDeleteMessageCallback(result:String):void {
	//Do something with the result
} 
 
function deleteRichMessage(msgID:int):void {
    _appoxeeANE.deleteRichMessage(msgID,handleDeleteMessageCallback);
}

...



Refresh Inbox

/**
* Reload inbox messages [note: not available for Android]
* @param func callback function to get result
*/
public function refreshInbox(func:Function):void

Code Block
languagejs
titleExample
private function handleRefreshInboxCallback(result:String):void {
	//Do something with the result
}
...
function refreshInbox():void {
   _appoxeeANE.refreshInbox(handleRefreshInboxCallback);
} 

 



Disable Inbox

/**
* Enable/disable inbox messages [note: not available for Android]
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setInboxEnabled(value:Boolean,func:Function):void

Code Block
languagejs
titleExample
private function setInboxCallback(result:String):void {
	//To something with the result 
}
... 
function toggleInbox(value:Boolean):void {
    _appoxeeANE.setInboxEnabled(value,setInboxCallback);
}

...



Inbox Enabled

/**
* Return if inbox is enabled on the device [note: not available for Android]
* @return  true/false (is the Inbox Enabled or Disabled)
*/
public function isInboxEnabled():Boolean

Code Block
languagejs
titleExample
 
function isInboxEnabled():Boolean{
    _appoxeeANE.isInboxEnabled();
}


Tags API

Info

Tags are not available for DMC customers yet (coming soon)

Remove Tags

/**
* Remove a tag to device, must be one which is listed on app tags (see getApplicationTags())
* @param removeTag tag to add (set false)
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function removeTagFromDevice(removeTag:String,func:Function):void

Code Block
languagejs
titleExample
private function handleRemoveTagCallback(result:String):void {	

}
... 
function removeTagsFromDevice(tag:String):void {
	_appoxeeANE.removeTagFromDevice(tag,handleRemoveTagCallback);
}

 



Add Tag

/**
* Add a tag to device, must be one which is listed on app tags (see getApplicationTags())
* @param setTag tag to add (set true)
* @param func callback function to get result (expected : "true" when the operation is successful , Empty Result (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function addTagToDevice(setTag:String,func:Function):void

...

Code Block
languagejs
titleExample
private function getDeviceTagsCallback(result:String):void {
	//Result is device tags
}
 
function fetchDeviceTags():void {
    _appoxeeANE.getDeviceTags(getDeviceTagsCallback);
}

...



Application Tags

/**
* Get application tags - a list of tags supported by your app configuration on dashboard
* @param func callback function to get result (expected : The Application's Tags, when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function getApplicationTags(func:Function):void

Code Block
languagejs
titleExample
private function getAppTagsCallback(result:String):void	{
	//Result is application tags
}
... 
function fetchApplicationTags():void {
	_appoxeeANE.getApplicationTags(getAppTagsCallback);
}

...


Push API

Push Enabled

/**
* Return if push are enabled on the device
* @return true/false (Is Push Enabled or Disabled)
*/
public function isPushEnabled():Boolean

Code Block
languagejs
titleExample
function isPushEnabled():Boolean {
  	return _appoxeeANE.isPushEnabled();
}

 



Enable Push

/**
* Enable/disable push messages (soft opt-out)
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setPushEnabled(value:Boolean,func:Function):void

Code Block
languagejs
titleExample
private function setPushCallback(result:String):void {
	//result is true/false is operation is successful
}
... 
function setPushEnabled(value:Boolean):void {
    _appoxeeANE.setPushEnabled(value,setPushCallback);
}

 



Badge Enabled

/**
* Return if badges are enabled on the device
* @return true/false (Is Badge Enabled or Disabled)
*/
public function isBadgeEnabled():Boolean

Code Block
languagejs
titleExample
 
function isPushBadgeEnabled():Boolean {
    return _appoxeeANE.isBadgeEnabled();
}

 



Disable Badge

/**
* Enable/disable badge [note: not available for Android]
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setBadgeEnabled(value:Boolean,func:Function):void

Code Block
languagejs
titleExample
private function setBadgeCallback(result:String):void {
	//result is true/false is operation is successful
}
 
function togglePushBadge(value:Boolean):void {
    _appoxeeANE.setBadgeEnabled(value,setBadgeCallback);
}

...


Custom Fields API

Set Date Field

...

Code Block
languagejs
titleExample
private function setDateCustomFieldCallback(result:String):void	{
	//result is true/false is operation is successful
}
 
function setDateNowField(key:String) {
    _appoxeeANE.setDateCustomField(key,new Date(),setDateCustomFieldCallback);
}

...



Set Numeric Filed

/**
* Set a value to a numeric custom field
* @param name custom-field name
* @param value value to set
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setNumericCustomField(name:String,value:Number,func:Function):void

Code Block
languagejs
titleExample
private function setNumericCustomFieldCallback(result:String):void {
	//result is true/false is operation is successful
} 
 
function setNumericField(key:String,value:Number) {
   _appoxeeANE.setNumericCustomField(key,value,setNumericCustomFieldCallback);
}

 

 



Increment Numeric Field

/**
* Incerement a custom numeric field value [note: not available for Android]
* @param name custom-field name
* @param value amount to add
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function incNumericCustomField(name:String,value:Number,func:Function):void

Code Block
languagejs
titleExample
private function getCustomFieldAfterIncCallback(result:String):void	{
	//Do something with result
}
 
function incrementNumericField(key:String,value:Number) {
	_appoxeeANE.incNumericCustomField(key,value,incNumericCustomFieldCallback);
}

 



Set String Field

/**
* Set value to a String custom field
* @param name custom-field name
* @param value value to set
* @param func callback function to get result (expected : "true" when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function setStringCustomField(name:String,value:String,func:Function):void

Code Block
languagejs
titleExample
private function setStringCustomFieldCallback(result:String):void {
	//result is true/false is operation is successful
}
 
function setStringField(key:String,value:String) {
   _appoxeeANE.setStringCustomField(key,value,setStringCustomFieldCallback);
}

 



Get Custom Field

/**
* Get custom field value, string representation
* @param name custom-field name
* @param func callback function to get result (expected : the value of the field as string, when the operation is successful , "false" (in Android) or NSError as String (in iOS) if operation has failed)
*/
public function getCustomField(key:String,func:Function):void

Code Block
languagejs
titleExample
private function getCustomFieldCallback(result:String):void	{
	//Result is the returned value, as string
}
 
function fetchCustomFieldByKey(key:String) {
   	_appoxeeANE.getCustomField(key,getCustomFieldCallback);	
}

 

...