Skip to main content
Participating Frequently
February 16, 2017
Question

Passing arguments to desktop app from browser

  • February 16, 2017
  • 1 reply
  • 762 views

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 has been closed for replies.

1 reply

User Unknow
Legend
February 17, 2017

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

Participating Frequently
February 20, 2017

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,

User Unknow
Legend
February 20, 2017

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