Versions Compared

Key

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

...

Code Block
languageactionscript3
firstline1
titleCode into your main .as file
linenumberstrue
//Add this to imports : 
import com.appoxee.AppoxeeANE;
...

//Add this to class : 
private var _appoxeeANE:AppoxeeANE;

//Add the class's constructor : 
_appoxeeANE = new AppoxeeANE("YOUR_APPOXEE_APP_KEY","YOUR_APPOXEE_SECRET_KEY",handleIncomingPushMessage);
...
 
//Add this method to get notified when push messages arrive to the device
private function handleIncomingPushMessage(payload:String):void {
			trace("Handle Incoming Push Message Called with : "+result);
			//Parse the JSON-Formatted String into an ActionScript Object
			//All fields from JSON are accessible by theit property names here
			 var data:Object = JSON.parse(payload);
 
			//Rest of your logic
			
}

 


Parsing the Push Payload

In order to parse the JSON-Formatted String to an ActionScript Object, you will need to use JSON.Parse() method which part of ActionScript, as explained in the following link.

Note
titleAppStore ID and URL extra fields handling

Be advised :

The Appoxee AppStoreID Extra Field (apx_aid) & The Appoxee URL Extra Field (apx_url) are being handled internally by the plugin.
The Appoxee AppStoreID Extra Field will divert to the relevant App Store : Apple's on iOS , Google's on Android.
The Appoxee URL Extra Field will open the url in the device's Web Browser.

...


The following JSON-Formatted Strings are the payloads for Adobe Air under Android OS : 

...