ios - Adobe Flex/AIR iOS 应用程序 - 如何将参数传递到应用程序中?

标签 ios apache-flex air flash-builder

我能够使用链接 example://abc 成功打开我的应用。

但是我需要在 URI 末尾捕获 abc 参数。

这是应用程序的代码

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="240"
           creationComplete="creationComplete(event)">

    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            protected function creationComplete(event:FlexEvent):void
            {
                NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, onInvokeEvent);
            }

            private function onInvokeEvent(e:BrowserInvokeEvent):void 
            { 
                var arguments:Array = e.arguments; 

                testLabel.text = "Args passed" //This never happens
            }

        ]]>
    </fx:Script>

    <s:Label id="testLabel" x="56" y="163" text="Testing invocation"/>

</s:Application>

我还确保对 app.xml 文件进行了以下更改:

<allowBrowserInvocation>true</allowBrowserInvocation>

<iPhone>
    <InfoAdditions><![CDATA[
        <key>CFBundleURLTypes</key> 
            <array> 
                <dict> 
                     <key>CFBundleURLSchemes</key> 
                    <array> 
                        <string>example</string> 
                    </array> 
                    <key>CFBundleURLName</key> 
                    <string>com.example.app</string> 
                </dict> 
            </array>
    ]]></InfoAdditions>
</iPhone>

我需要进行哪些更改才能捕获此应用的参数?

最佳答案

因为我是从另一个应用程序(日历)启动应用程序,所以我需要使用 InvokeEvent 而不是 BrowserInvokeEvent。

关于ios - Adobe Flex/AIR iOS 应用程序 - 如何将参数传递到应用程序中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25135023/

相关文章:

css - 如何使用 CSS 更改 flex 中的标签颜色?

java - 使用 Xuggler 和 Red5 保存视频和其他音频之一的两个流

actionscript-3 - 视网膜支持的 AIR 项目尺寸

ios - AVAssetExportSession exportAsynchronouslyWithCompletionHandler : Source frame unsupported format

ios - 以编程方式自动布局

iOS EventKit : Display calendar in a different section other than iCloud/On My iPhone

apache-flex - Flash Builder 中的内部构建错误

actionscript-3 - 是否有可能通过 as3 控制 iphone/android 的手电筒?

flash - 使用loadCompressedDataFromByteArray加载声音并稍后播放?

ios - 如何将 facebook token 安全地扔到自己的服务器上?