=================================
=================================
=================================
출처: http://blog.naver.com/babdeuk/90163825962
The Space For App Developers
Defining custom URL schemes for your AIR mobile applications
twitter.com/widgets/tweet_button.1366154648.html#_=1366185332070&count=vertical&id=twitter-widget-0&lang=en&original_referer=http%3A%2F%2Fwww.riaspace.com%2F2011%2F08%2Fdefining-custom-url-schemes-for-your-air-mobile-applications%2F&size=m&text=Defining%20custom%20URL%20schemes%20for%20your%20AIR%20mobile%20applications%20at%20The%20Space%20For%20App%20Developers&url=http%3A%2F%2Fwww.riaspace.com%2F2011%2F08%2Fdefining-custom-url-schemes-for-your-air-mobile-applications%2F" class="twitter-share-button twitter-count-vertical" title="Twitter Tweet Button" data-twttr-rendered="true" style="padding: 0px; margin: 0px; width: 59px; height: 62px;"></iframe>If you’ve ever wondered if you can register your own URL schemes for your AIR mobile applications running on iOS or Android platforms the answer is yes! Actually it is very simple and you can do it by adding few extra lines in the *-app.xml document. Once you do your application can be invoked directly from other applications or browser with a simple <a href="my-scheme:">open app</a> link click.
(Custom URL schemes are especially useful if you are doing OAuth authentication in your app and you want to redirect the user back to your application after the authorization in the browser. You can find out more about OAuth in AS3/Flex applications in my ADC tutorials.)
To register a custom URL scheme like my-scheme: you simply add the following code in your *-app.xml.
Android settings:
iOS settings:
Also you can pass additional arguments to your app from the invoking source. Arguments can be passed in the URL scheme after the colon; for example: my-scheme:myparam
. Then in your application you can listen forInvokeEvent.INVOKE
event on the NativeApplication.nativeApplication
instance. The received event object contains an arguments
property that returns an Array with the invoking scheme and parameters in the first item, so it would be my-scheme:myparam
value. Next you can parse the value of your argument, and take some action in the application based on its value.
In a Flex Mobile app you can register an InvokeEvent.INVOKE
event listener in the preinitialize
phase as in following snippet:
One caveat is that invoking other apps with the custom URL schemes from AIR apps is not possible. The AIR security model is more restrictive and it limits schemes to: http:, https:, sms:, tel:, mailto:, file:, app:, app-storage:, vipaccess: and connectpro:
. You can find more about it here and here
.
=================================
=================================
=================================
출처: https://forums.adobe.com/message/5146487#5146487
=================================
=================================
=================================
댓글 영역