菜单

Webview redirect to Native App

2014年10月9日 - PhoneGap

PhoneGap

if you put this logic in on your "site" along wiht the cordova include, you will be able to redirect back to native html pages from a site html page.  You will have your base path for the redirect, then you just need to know the exact file name that you are trying to redirect to.
  function onDeviceReadyIOS() {
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFS, null);
        }
        function onFS(fs) {
            iOSFilePath = fs.root.toURL();
                pathForNativeRedirect = iOSFilePath.replace("/Documents", "").replace("localhost", "").replace(/ /g, '%20') + '/[your app name].app/www/';
        }
        function onDeviceReadyAndroid() {
            pathForNativeRedirect = 'file:///android_asset/www/';
        }

发表评论

电子邮件地址不会被公开。 必填项已用*标注