【问题标题】:Where can I find the file object with the getImage API when the iOS location is not allowed by the user?当用户不允许 iOS 位置时,我在哪里可以使用 getImage API 找到文件对象?
【发布时间】:2012-05-04 18:23:54
【问题描述】:

当用户不允许 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 模式?

【问题讨论】:

    标签: trigger.io


    【解决方案1】:

    当您使用file.getImage 时,可能会提示用户提供位置许可的原因是因为图像的 EXIF 元数据中嵌入了位置数据,可用于暗中推断其位置。

    这仅在您读取图库中的数据时发生:如果您将saveLocation: "file" 参数用于getImage,则不会提示用户提供位置权限。

    无论哪种情况,file.getImage 的成功回调都应始终使用文件对象调用(除非用户完全取消了图像捕获):只有当您使用文件时可能需要位置权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-04
      • 2018-02-21
      • 1970-01-01
      相关资源
      最近更新 更多