ios - 适用于 iOS 的 AIR : download a file (from remote server) and open it with default app

标签 ios flash air

我希望我的应用程序(在 iOS 上移植的 AIR 应用程序)能够显示位于远程服务器上的文件并使用默认应用程序打开它(如果设备上有一个)。有可能吗(也许可以在这里使用 openWithDefaultApp )?最简单的方法是什么?

提前谢谢您!

UPD:我成功下载(到File.documentsDirectory)。我无法强制 iPad 打开下载的文件。

UPD2:我尝试同时使用openWithDefaultAppNavigateToUrl

最佳答案

我认为 iOS 或 Android 不支持 openWithDefaultApplication

Adobe Ideas 有对此功能的请求:

http://ideas.adobe.com/ct/ct_a_view_idea.bix?c=9D564F43-979A-4E35-AA21-85A61B6AB8DE&idea_id=6B8A5F97-BD20-4CCE-A921-1D6006B4608E

您也许可以使用 StageWebView,例如查看 PDF 文档:

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.geom.Rectangle;
    import flash.media.StageWebView;

    public class PdfViewer extends Sprite
    {
        public function PdfViewer()
        {
            super();

            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;

            var stageWebView:StageWebView = new StageWebView();
            stageWebView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
            stageWebView.stage = stage;
            stageWebView.loadURL("document.pdf");
        }
    }
}

关于ios - 适用于 iOS 的 AIR : download a file (from remote server) and open it with default app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9994064/

相关文章:

ios - 核心数据一对多关系在获取新对象后失去关系

jquery - 我应该使用什么 "platform"来开发在线交互式图像 map ?

actionscript-3 - 麦克风数据采样

android - 使用适用于 Android 的 Adob​​e Air Mobile 顺畅地调整 View 以响应设备方向

ios - Adobe Air IOS 中的黑色边框

objective-c - 模态视图 Controller 第一次显示空白,随后正常工作

ios - cocoa pod 更新破坏了一些东西,现在 "pod update"产生错误

ios - Xamarin 表格 : How to clear old distribution certificate and provisioning profile from ios bundle signing?

flash - 在 Flash Builder 4.5 上生成 IPA 文件 (iphone)

c# - 在 2021 年播放 .swf 文件?