2
Ich möchte Audiodateien (mp3, m4a, wma ...) mit Google Drive API herunterladen. Beim folgenden Code habe ich den Fehler im Simulator bekommen.Wie Audiodatei herunterladen?
Fehler:
The operation could't be completed. (The user has not granted the app xxxx read access to the file alEnlflseiFNSEi.)
Code:
let url = "https://www.googleapis.com/drive/v3/files/\(identifier)?alt=media"
service.fetchObject(
with: URL(string: url)!,
delegate: self,
didFinish: #selector(GoogleDriveFileListTableViewController.downloadWithTicket(ticket:finishedWithObject:error:))
)
// Parse results and display
func downloadWithTicket(ticket : GTLServiceTicket, finishedWithObject response : GTLDriveFileList, error : NSError?) {
if let error = error {
showAlert(title: "Error", message: error.localizedDescription)
return
}
}
Dank. Ich hab es geschafft. Und ich habe einen Fehler gefunden. Brauchen Sie nicht alt = Medien in URL. – yongwoon
Ich überprüfe Antwort von Web. – yongwoon