Copy link to clipboard
Copied
I'm trying to develop a service application on ios. I know that I could use custom url schema to communicate between applications and I can get handleUrl event , in case of using objective c. But I don't know if I can do that or how to do that in flash builder 4.5.1.
I found an article which said I can regist my custom url schema in app.xml but I found nothing about how I can handle the custom url call. Is there an event or what? Does anybody know that?
Thanks!
Hi Jenny,
I've just tried custom URI with iOS and I am able to receive the argument with length 1, which has the complete url I browsed.
For Eg: If I launch url example://xyz?abc, I get the complete url as 1st element of the e.arguments array.
public function invokeHandler(e:InvokeEvent):void{
label1.text = "";
label1.appendText(e.arguments.length.toString() + " ");
for (var i:int=0;i<e.arguments.length;i++)
{
label1.appendText(e.arguments + " ");
}
label1.appendText(e.reason);
}
Reason should a
...Copy link to clipboard
Copied
Hi Jenny,
Custom URIs in app xml are specific to Android AIR.
For iOS, AFAIK, there is no way to call applications.
-Pahup
Copy link to clipboard
Copied
I haven't tried it on iOS myself, but was told by one of the AIR engineers that it should work. (http://help.adobe.com/en_US/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1...)
When your app is invoked by this, or any other means, the NativeApplication object dispatches an InvokeEvent object. The URL should be in the arguments array. See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/InvokeEvent.html.
Copy link to clipboard
Copied
Hi Joe,
Thank you for your answers. But I still have another question about this issue.
In fact, my application needs to do two things. Firstly the application should be able to be called by the second application which is developed by xcode. You already give me the answer of how to do that. I'll try later. Thanks again.
Secondly, my application needs to call the xcode application to get some data from it. I already developped and tested the xcode application. It works fine. The xcode application is called by customer URL schema. But I don't know how to call it using Flash builder 4.5.1. I tried to use "navigateToURL", but it doesn't work. So could you please give me some suggestion about this?
Jenny
Copy link to clipboard
Copied
Unfortunately, the second operation isn't supported yet. In the next major release of AIR, using navigateToURL() to invoke another app should be supported.
Assuming you can't wait until then, you might be able to listen for an incoming socket connection in the native XCode application and then connect to it with the AIR app -- although I'm not sure how the limited multi-tasking available on iOS might restrict this sort of app-to-app communication. If there's a location where both applications are allowed to read and write a file, that could be used as a workaround, too.
Copy link to clipboard
Copied
Hi Joe,
Thanks for you quick reply.
May I ask when the next major release of Air is available? : )
Jenny
Copy link to clipboard
Copied
Sorry, we haven't announced an availability date yet. In the meantime, you could request access to the Adobe prerelease program, which would let you test AIR 3 features before they are publically available. https://prerelease.adobe.com/callout/?callid=D5B9AEF3B7024EE2BCD91685B660620B
Copy link to clipboard
Copied
Hi Joe,
Thanks a lot. Have a good weekend!
Jenny
Copy link to clipboard
Copied
Hi Pahup,
Thanks for your answer first.
I tried the solution. I have a good news and a bad news.
The good one is I can use the customized URI schema to configure my application so that another application can call it using the url. It really works. : )
But unfortunately, I didn't get the url as an argument in INVOKE.event. In fact, the argument array is empty and the invoke reason is just "standard" which means I can not find out if the application is invoked by a url call.
Could you please tell me if that it is now? Thanks a lot.
Jenny
Copy link to clipboard
Copied
Hi Jenny,
I've just tried custom URI with iOS and I am able to receive the argument with length 1, which has the complete url I browsed.
For Eg: If I launch url example://xyz?abc, I get the complete url as 1st element of the e.arguments array.
public function invokeHandler(e:InvokeEvent):void{
label1.text = "";
label1.appendText(e.arguments.length.toString() + " ");
for (var i:int=0;i<e.arguments.length;i++)
{
label1.appendText(e.arguments + " ");
}
label1.appendText(e.reason);
}
Reason should always be standard if it's not launched from login. Currently on Mobile it will be standard only.
Hope it helps.
-Pahup
Copy link to clipboard
Copied
Hi Pahup,
Thank you very much. You are right. The url is in argument array.
I didn't show the arguments in a visual object in my previous test. I used debug mode and traced the arguments. I called the application when it was in background mode. In debug window, the argument length was zero.
Have a nice weekend!
Jenny