• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

onInvoke doesn't pass parameters on iOS

Explorer ,
Feb 24, 2017 Feb 24, 2017

Copy link to clipboard

Copied

Hi,

On iOS, the onInvoke event doesn't pass the parameters from a customer URL link _unless_ the iOS app is running. I have used all the docs and examples, and the onInvoke event fires correctly - but the event.arguments is empty if the app is opened. Once the app is running, the link from the browser works as expected, and the event.arguments is populated.

The condition above makes the onInvoke event useless for most users. Anyone find a workaround?

TOPICS
Air beta

Views

624

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 04, 2017 Apr 04, 2017

After a lot of testing, I came to the solution: the INVOKE event is being fired twice in rapid succession when the app is first opened using the above code. The first event has the proper URL in it, while the second is empty. If the app is open already, the event is still fired, but both times it contains the proper URL in the arguments[0].

Votes

Translate

Translate
Engaged ,
Feb 24, 2017 Feb 24, 2017

Copy link to clipboard

Copied

I don't know how you did it but it woks for me even when the app isn't running when the user click on the link.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 24, 2017 Feb 24, 2017

Copy link to clipboard

Copied

That's great to hear. I haven't been able to make it work. Using the code below, the _appURL variable is empty if the app hasn't been started previously. If it has, _appURL has the full path from the HTML properly passed. You are seeing different results? How?

HTML: <a href="myapp://?taskID=1010181">Preview a Task</a>

And in the AS3 code:

// in startup code

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

// onInvoke callback

  public function onInvoke(event:InvokeEvent):void {

 

       var args:Array = event.arguments;

       _appFullArgs = args;

       _appURL = args[0];

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 24, 2017 Feb 24, 2017

Copy link to clipboard

Copied

Did you try without the "?" in the arg?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 23, 2017 Mar 23, 2017

Copy link to clipboard

Copied

Yes, tried that - doesn't work. I still get 'null' returned as the URL.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

After a lot of testing, I came to the solution: the INVOKE event is being fired twice in rapid succession when the app is first opened using the above code. The first event has the proper URL in it, while the second is empty. If the app is open already, the event is still fired, but both times it contains the proper URL in the arguments[0].

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines