Apple reject my app because of not include functionality to allow users to view or select items from the Files app


Apple reject my app because of not include functionality to allow users to view or select items from the Files app



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


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



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



Here is Apple give me the reason:



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.





you added permission in .info file?
– Chirag Kothiya
Jun 29 at 6:50





@ChiragKothiya yes Buddy Privacy - Photo Library Additions Usage Description , i set above permission into .plist.
– Nilesh
Jun 29 at 7:02




2 Answers
2



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


UIDocumentPickerViewController



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)
}
}
}
}





Thanks for your valuable Answer but actually i really don't know how to start with UIDocumentPickerViewController , if possible then give me some step , so i can open Videos With UIDocumentPickerViewController.
– Nilesh
Jun 29 at 8:40



I could see the clause in the review guideline



2.5.15 Apps that enable users to view and select files should include items from the Files app and the user’s iCloud documents.



Looks like you should add UIDocumentPickerViewController support as @Paulw11 pointed out


UIDocumentPickerViewController





Good spot. I missed that. I will update my answer
– Paulw11
Jun 29 at 10:14






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV