ios


How to get the invoke arguments for an Adobe Air iOS app?


I would like to get the invoke arguments (e.g. a path to a file) from the Adobe Air Invoke Event for an Air for iOS app.
I tried the code below but the onAppInvoke function isn't fired after the app got launched.
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onAppInvoke);
function onAppInvoke(event:InvokeEvent):void {
trace("INVOKE ARGS: "+event.arguments[0]);
}
How to get the event arguments after the app got launched?
I'm using the latest Air SDK 16 and tested the app on iOS 8.1.
Whenever an AIR application is invoked, AIR dispatches an InvokeEvent object of type invoke through the singleton NativeApplication object. To allow an application time to initialize itself and register an event listener, invoke events are queued instead of discarded. As soon as a listener is registered, all the queued events are delivered.
Note: When an application is invoked using the browser invocation feature, the NativeApplication object only dispatches an invoke event if the application is not already running.
To receive invoke events, call the addEventListener() method of the NativeApplication object (NativeApplication.nativeApplication). When an event listener registers for an invoke event, it also receives all invoke events that occurred before the registration. Queued invoke events are dispatched one at a time on a short interval after the call to addEventListener() returns. If a new invoke event occurs during this process, it may be dispatched before one or more of the queued events. This event queuing allows you to handle any invoke events that have occurred before your initialization code executes. Keep in mind that if you add an event listener later in execution (after application initialization), it will still receive all invoke events that have occurred since the application started.
Only one instance of an AIR application is started. When an already running application is invoked again, AIR dispatches a new invoke event to the running instance. It is the responsibility of an AIR application to respond to an invoke event and take the appropriate action (such as opening a new document window).
An InvokeEvent object contains any arguments passed to the application, as well as the directory from which the application has been invoked. If the application was invoked because of a file-type association, then the full path to the file is included in the command line arguments. Likewise, if the application was invoked because of an application update, the full path to the update AIR file is provided.
When multiple files are opened in one operation a single InvokeEvent object is dispatched on Mac OS X. Each file is included in the arguments array. On Windows and Linux, a separate InvokeEvent object is dispatched for each file.
Your application can handle invoke events by registering a listener with its NativeApplication object:
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvokeEvent);
var arguments:Array;
var currentDir:File;
public function onInvokeEvent(invocation:InvokeEvent):void {
arguments = invocation.arguments;
currentDir = invocation.currentDirectory;
}

Related Links

How can I reset UserDefaults for XCTestCase?
Bluetooth pairing in iOS: how to tell if pairing dialog will come up?
can't customize navigationbar frame in iOS 10?
CGImageDestinationFinalize or UIImageJPEGRepresentation - Crash when saving a large file on IOS 10
Swift + Firebase Security not working
Branching off from a tab bar controller?
Is SpeechKit framework supported in watchOS 3?
Xamarin UIImage rotation
Parse iOS SDK: saveEventually and logout
Getting crash when ice candidate delegate method called
How to avoid `NSNotificationCenter:postNotificationName:object` add the reference count of the user object?
Importing Calendar events from iCloud IOS
how to add click listener to notifcation of react-native-fcm
Converting XLPagerTabStrip to swift3 causes error
security / codesign in Sierra: Keychain ignores access control settings and UI-prompts for permission
Can I change height of UITableViewCell real-time?

Categories

HOME
regex
flutter
common-lisp
demandware
vr
quickblox
arm
intel-xdk
active-directory
spacemacs
coded-ui-tests
dbus
h2o
proftpd
vulkan
html5-video
installer
qualtrics
aar
jgit
factory-girl
jquery-selectors
flow
aerospike
graphcool
silk-performer
abaqus
textmatebundles
multiprocessing
centroid
zos
shape
listbox
rrd
paket
temp
pymysql
server-sent-events
aem-6
google-domain-api
outlook-vba
draggable
presto
flags
ipod-touch
sagepay
firedac
linear
projection
spark-submit
phasset
pulseaudio
appdynamics
default-browser
psycopg2
vega-lite
multisite
okular
infiniband
derbyjs
fasta
ice
zenity
turbo-c
topojson
tfs2008
ubuntu-15.04
xnamespace
agents-jade
android-location
groups
winobjc
balana
genetic
laravel-forge
linq2db
hjson
rdotnet
push-api
error-log
odoo
alt
mkpolyline
spiceworks
imaging
before-save
custom-titlebar
b2b
jqgrid-php
declspec
junit-runner
parsekit
modx-evolution
xcode4.2
northwind
datadesign
blackberry-cascades
headless-browser
android-actionmode
rgba
ed
expressionvisitor
bapi
datatemplate
textboxlist
nntp
jquery-pagination
arraycopy
stsadm
palm-pre
shareware

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App