filepicker.io与IOS上的手机差距 [英] filepicker.io with phone gap on IOS

查看:300
本文介绍了filepicker.io与IOS上的手机差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将filepicker.io与iOS6 for iPad上的Phonegap 2.2.0项目集成。在文件filepicker.io他们说,只是得到childbrowser运行,你设置。 ( https://github.com/Filepicker/filepicker-phonegap )好吧,我有子浏览器运行和测试典型的google示例。但是当我尝试调用api像他们的android示例,它不工作。我也编辑了白名单,因为错误。问题是:有人曾经在iOS上尝试过吗?没有找到的例子。提前感谢。

I am trying to integrate filepicker.io with my Phonegap 2.2.0 project on iOS6 for iPad. In the docs on filepicker.io they say, just get childbrowser running and you are set. ( https://github.com/Filepicker/filepicker-phonegap ) Well, I got child browser running and tested the typical google example. But when I try to call the api like in their android example, it doesn't work. I edited the whitelist as well because of errors. The question is: Did somebody ever tried it on iOS? There are no examples to be found. Thanks in advance.

推荐答案

要使用新的V1 API在iOS上运行,您需要手动创建自己的filepicker字符串并直接在childbrowser中打开,在字符串的末尾,您需要附加重定向网址。以下是如何为照片做的:

To get it running on iOS with their new V1 API, you need to create your own filepicker string manually and open in directly in the childbrowser and at the end of the string you need to append a redirect url. Here is how you do it for photos:

pick: function() {
    cb = window.plugins.childBrowser;
    if(cb!=null){
        cb.onLocationChange = function(loc){
            if (loc != "about:blank"){
                console.log(loc);
                if(loc.indexOf("fpurl") > -1) {
                cb.close();
                }
            var n = loc.split("fpurl=");
            fpurl = n[1];
            alert(fpurl);
        }
    };
cb.showWebPage("https://www.filepicker.io/dialog/open/?m=image/*&key="YOURAPIKEY"&referrer=&modal=false&redirect_url=https://www.filepicker.io/dialog/phonegap_done/");
}

这篇关于filepicker.io与IOS上的手机差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆