Apple拒绝我的应用程序,因为它不包含允许用户查看或从“文件”应用程序中选择项目的功能 [英] Apple reject my app because of not include functionality to allow users to view or select items from the Files app

查看:556
本文介绍了Apple拒绝我的应用程序,因为它不包含允许用户查看或从“文件”应用程序中选择项目的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用以下方法从图库中获取视频:

In my app I am get video from gallery using below method:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
}

但Apple被拒绝app并且需要包含从文件应用程序中选择视频项目的功能。

But Apple is rejected app and required to include functionality to select video items from Files app.

这是Apple给我原因:

Here is Apple give me the reason:


我们注意到您的应用程序允许用户查看和选择文件,但是
它不包含允许用户从文件应用程序和用户的iCloud文档中查看或选择
项目的功能,根据App Store审查指南的要求

We noticed that your app enables users to view and select files, but it does not include functionality to allow users to view or select items from the Files app and the user's iCloud documents, as required by the App Store Review Guidelines.


推荐答案

似乎他们希望您使用 UIDocumentPickerViewController 使用户能够根据第2.5.15条从云服务以及照片库中选择视频文件

It seems that they want you to use UIDocumentPickerViewController to enable users to select video files from cloud services as well as from the photo library in accordance with clause 2.5.15

Appl e希望他们的客户能够很好地体验他们的设备及其运行的应用程序,因此您的应用程序支持所有相关的iOS功能是有意义的。

Apple wants their customers to have a good experience with their device and the apps they run on it, so it makes sense for your app to support all relevant iOS features.

你可以创建一个文档选择器来显示选择视频文件:

You can create a show a document picker to select video files using:

let picker = UIDocumentPickerViewController(documentTypes: ["public.movie"], in: .import)
picker.delegate = self
self.show(picker, sender: self)

您需要实现一些委托代码来处理所选文档。例如,要将所选文件复制到应用程序的文档目录中:

You will need to implement some delegate code to handle the picked document. For example, to copy the selected file into your app's documents directory:

extension ViewController: UIDocumentPickerDelegate {
    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
        if let pickedUrl = urls.first {
            let filename = pickedUrl.lastPathComponent
            self.filename.text = filename
            let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
            var documentsDirectory = paths[0]
            // Apend filename (name+extension) to URL
            documentsDirectory.appendPathComponent(filename)
            do {
                // If file with same name exists remove it (replace file with new one)
                if FileManager.default.fileExists(atPath: documentsDirectory.path) {
                    try FileManager.default.removeItem(atPath: documentsDirectory.path)
                }
                // Move file from app_id-Inbox to tmp/filename
                try FileManager.default.moveItem(atPath: pickedUrl.path, toPath: documentsDirectory.path)
                UserDefaults.standard.set(filename, forKey:"filename")
                UserDefaults.standard.set(documentsDirectory, forKey:"fileurl")
                self.fileURL = documentsDirectory
            } catch {
                print(error.localizedDescription)
            }
        }
    }
}

这篇关于Apple拒绝我的应用程序,因为它不包含允许用户查看或从“文件”应用程序中选择项目的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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