Skip to content

Commit

Permalink
fixed url link for downloading drive file
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardik Garg committed Feb 2, 2024
1 parent 25134e8 commit 58d12c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ios/OpenBot/OpenBot/Authentication/Authentication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class Authentication {
*/
static func download(file: String, completion: @escaping (_ data: Data?, _ error: Error?) -> Void) {
let fileId = returnFileId(fileLink: file);
let url = "https://drive.google.com/uc?export=download&id=\(fileId)&confirm=200"
let service: GTLRDriveService = GTLRDriveService()
let url = "https://www.googleapis.com/drive/v3/files/\(fileId)?alt=media&key=AIzaSyCITlkh63TnSnJQBlzqbJwwtBDr_w3e1Pg" //key extracted from google console
let service: GTLRDriveService = GTLRDriveService();
let fetcher = service.fetcherService.fetcher(withURLString: url)
fetcher.beginFetch(completionHandler: { data, error in
if let error = error {
Expand All @@ -162,7 +162,7 @@ class Authentication {
*/

static func download(fileId: String, completion: @escaping (_ data: Data?, _ error: Error?) -> Void) {
let url = "https://drive.google.com/uc?export=download&id=\(fileId)&confirm=200"
let url = "https://www.googleapis.com/drive/v3/files/\(fileId)?alt=media&key=AIzaSyCITlkh63TnSnJQBlzqbJwwtBDr_w3e1Pg" //key extracted from google console
let service: GTLRDriveService = GTLRDriveService()
let fetcher = service.fetcherService.fetcher(withURLString: url)
fetcher.beginFetch(completionHandler: { data, error in
Expand Down

0 comments on commit 58d12c2

Please sign in to comment.