简体   繁体   中英

navigateToURL failed open up browser on iPad (Adobe Air)

Quick question, I am using Adobe AIR to develop an app under iPad. Why navigateToURL not open up the Safari under iPad? it works under Android.

if(e == 'pdf')
{
    loader.addEventListener(Event.COMPLETE, function(e)
    {
        var variables:URLVariables = new URLVariables(e.target.data);
        var url:String = 'http://files.au2.schneider-electric.com/locator/index.php?controller=pdfGenerator&action=fetchroom&roomid=' + variables.roomid + '&userid=0';
        var request:URLRequest = new URLRequest(url);

        try
        {
            navigateToURL(request, '_blank'); // second argument is target
        }
        catch(e:Error)
        {
            trace("Error occurred!");
        }
    });
}

Just wondering is it Adobe Air can't open browsers on Mobiles Devices at all?

I don't think you can expect that PDFs load like regular webpages on iOS. This is untested, but the idea is to create a StageWebView instance, using it to load the PDF:

var swv:StageWebView = new StageWebView();
swv.viewPort = new Rectangle(0,0,wid,ht);
swv.stage = stage;
swv.loadURL( someUrl );

EDIT:

See the Adobe docs on StageWebView as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM