I want to select files from Google drive and One drive cloud services for that purpose I am using UIDocumentPickerViewController
ex:
func didPressOneDriveChoose() {
let importMenu = UIDocumentPickerViewController(documentTypes: [(kUTTypePDF as String), (kUTTypeJPEG as String), (kUTTypePNG as String)], in: .import)
importMenu.delegate = self
importMenu.modalPresentationStyle = .formSheet
self.show(importMenu, sender: nil)
}
Recived callBack on delegate method:
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]){
var arrFiles = [Dictionary<String, AnyObject>]()
for url in urls {
// returns local document directory URL
// needs original GoogleDrive or OneDrive URL
}
}
but I want to know is there any way to get which cloud service is selected by the user and also I want original URL pointing to that URL? Currently, it returns local documents directory URL after downloading that file on click.