Skip to content

Instantly share code, notes, and snippets.

@creativedrewy
Last active December 11, 2015 04:08
Show Gist options
  • Save creativedrewy/4542529 to your computer and use it in GitHub Desktop.
Save creativedrewy/4542529 to your computer and use it in GitHub Desktop.
Sample Adobe AIR Android application class that handles incoming NFC intent data.
package
{
import flash.desktop.NativeApplication;
import flash.events.InvokeEvent;
public class NFCDataHandling extends Sprite
{
/**
* Constructor
*/
public function NFCDataHandling()
{
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onApplicationInvoke, false, 0, true);
}
protected function onApplicationInvoke(event:InvokeEvent):void
{
//If there is any intent data that was passed to the app - in this case, say an NFC URI - there
//will be data in event.arguments. It will be an array, and the first item will be
//the full URI string, i.e. {SCHEME}://{HOST}/{ARGS}
}
}
}
@creativedrewy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment