Skip to main content
Participating Frequently
Feb 16, 2017 3:53 PM UTC
Question

Passing arguments to desktop app from browser

I'm trying to pass arguments to my desktop app using cutom URI schemes. I can get the app to open from the browser, but the invoke event never seems to be dispatched, hence, I can't get arguments to the app. I'm adding the event listener on the main classes constructor like so :

public function MyApp()

{

  NativeApplication.nativeApplication.addEventListener( InvokeEvent.INVOKE, onInvoke );

  NativeApplication.nativeApplication.addEventListener( BrowserInvokeEvent.BROWSER_INVOKE, onInvoke );

  super();

}

public function onInvoke(e:*):void

{

  // NEVER TRIGGERED

  ConfigConstants.WAS_INVOKED = true;

  ConfigConstants.INVOKE_PARAMS = ArrayUtil.copyArray(e.arguments);

}

My HTML link looks like this :

<a href="myapp.open://hello&world">click</a>

Any ideas ?

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

User Unknow
Legend
Feb 17, 2017 10:26 PM UTC

Your app must be packaged as Adobe AIR without embedded Runtime.

Translate
Participating Frequently
Feb 20, 2017 3:11 PM UTC

I'm guessing you are talking about using the allowBrowserInvocation tag in the app descriptor. I'm aware that tag cannot be true when using captive runtime. But my app is using captive runtime so that's not the technique I'm using anyway.

I've added a URI scheme to the app so I can open it from a web link, as : <a href="nameOfURIScheme://arg1&arg2">Open app</a>

I can get the app to open, I just cannot get the args.

Cheers,

Translate
User Unknow
Legend
Feb 20, 2017 4:23 PM UTC

How u add uri scheme?

Понедельник, 20 февраля 2017, 18:11 +03:00 от josephdecarie <forums_noreply@adobe.com>:

>Passing arguments to desktop app from browser created by josephdecarie in AIR Development - View the full discussion

Translate