【发布时间】:2014-08-05 09:09:01
【问题描述】:
我可以使用链接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>
我需要进行哪些更改才能捕获此应用的参数?
【问题讨论】:
标签: ios apache-flex air flash-builder