...
Code Block | ||||
---|---|---|---|---|
| ||||
private function setPushCallback(result:String):void { //result is true/false is operation is successful } ... function setPushEnabled(value:Boolean):void { _appoxeeANE.setPushEnabled(value,setPushCallback); } |
...
Custom Fields API
Set Date Field
/**
* Return if badges are enabled on the device
* @return true/false (Is Badge Enabled or Disabled)
*/
public function isBadgeEnabled():BooleanSet value to a Date 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 setDateCustomField(name:String,value:Date,func:Function):void
Code Block | ||||
---|---|---|---|---|
| ||||
private function isPushBadgeEnabledsetDateCustomFieldCallback():Booleanresult:String):void { //result is true/false is operation is successful } function setDateNowField(key:String) { return _appoxeeANE.isBadgeEnabled(setDateCustomField(key,new Date(),setDateCustomFieldCallback); } |
Disable BadgeSet Numeric Filed
/**
* Enable/disable badge [note: not available for Android]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 setBadgeEnabledsetNumericCustomField(name:String,value:BooleanNumber,func:Function):void
Code Block | ||||
---|---|---|---|---|
| ||||
private function setBadgeCallbacksetNumericCustomFieldCallback(result:String):void { //result is true/false is operation is successful } function togglePushBadgesetNumericField(key:String,value:BooleanNumber):void { _appoxeeANE.setBadgeEnabledsetNumericCustomField(key,value,setBadgeCallbacksetNumericCustomFieldCallback); } |
Custom Fields API
Set Date Increment Numeric Field
/**
* Set value to Incerement a Date custom numeric field value [note: not available for Android]
* @param name custom-field name
* @param value value amount to setadd
* @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 setDateCustomFieldincNumericCustomField(name:String,value:DateNumber,func:Function):void
Code Block | ||||
---|---|---|---|---|
| ||||
private function setDateCustomFieldCallbackgetCustomFieldAfterIncCallback(result:String):void { //resultDo issomething true/false is operation is successfulwith result } function setDateNowFieldincrementNumericField(key:String,value:Number) { _appoxeeANE.setDateCustomFieldincNumericCustomField(key,new Date(),setDateCustomFieldCallbackvalue,incNumericCustomFieldCallback); } |
Set Numeric FiledString Field
/**
* Set a value to a numeric 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 setNumericCustomFieldsetStringCustomField(name:String,value:NumberString,func:Function):void
Code Block | ||||
---|---|---|---|---|
| ||||
private function setNumericCustomFieldCallbacksetStringCustomFieldCallback(result:String):void { //result is true/false is operation is successful } function setNumericFieldsetStringField(key:String,value:NumberString) { _appoxeeANE.setNumericCustomFieldsetStringCustomField(key,value,setNumericCustomFieldCallbacksetStringCustomFieldCallback); } |
Increment Numeric Get Custom Field
/**
* Incerement a Get custom numeric field value [note: not available for Android], string representation
* @param name custom-field name
* @param value amount to add
* @param func func callback function to get result (expected : "true" 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 incNumericCustomFieldgetCustomField(namekey:String,value:Number,func:Function):void
Code Block | ||||
---|---|---|---|---|
| ||||
private function getCustomFieldAfterIncCallbackgetCustomFieldCallback(result:String):void { //Do something with resultResult is the returned value, as string } function incrementNumericFieldfetchCustomFieldByKey(key:String,value:Number) { _appoxeeANE.incNumericCustomFieldgetCustomField(key,value,incNumericCustomFieldCallbackgetCustomFieldCallback); } |
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 | ||||
---|---|---|---|---|
| ||||
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
...
language | js |
---|---|
title | Example |
...
iOS10 ONLY
Show Foreground Notifications / Get Foreground Notifications state
Code Block |
---|
function showOrHideForegroundNotificationOnIos10(key:Boolean) { _appoxeeANE.setShowForegroundNotifications(key,setShowNotificationsCallback); } private function setShowNotificationsCallback(result:String):void { { var res:Boolean = _appoxeeANE.getShowForegroundNotifications(); //Result is the returned value, as string } function fetchCustomFieldByKey(key:String) { _appoxeeANE.getCustomField(key,getCustomFieldCallback); } |