2012-05-03 11 views
1

当iOS位置不被用户允许时,我可以在哪里使用getImage API找到文件对象?当iOS位置不被用户允许时,我可以在哪里使用getImage API找到文件对象?

错误回调函数是否具有成功的文件对象,如下所示?

file.getImage(function (file) { /* the success scenario */ , function (file) { /* the error scenario but still has successful file object */); 

或将错误回调兼得的内容和文件的对象?

file.getImage(function (file) { /* do success scenario */ , function (content, file) { /* error scenario but has successful file object */); 

什么是此方案的正确API模式?

回答

1

的原因,当您使用file.getImage是因为位置数据嵌入其可用于暗中推断出它们的位置,在图像的EXIF元数据的用户可能会提示您位置的权限。

这只有当你从库中读取数据发生:如果您使用saveLocation: "file"参数getImage,用户将不会被提示输入位置的权限。

在这两种情况下,file.getImage成功的回调应始终与文件对象调用(除非用户取消了拍摄完全):这是只有当你来到使用可能需要的位置许可文件。

相关问题