我尝试使用Google表格API进行批量更新,但在“data [0] .values [0]”(type.googleapis.com/google.protobuf.ListValue)上收到错误无效值, 这是我的代码 NSString *baseUrl = @"https://sheets.googleapis.com/v4/spreadsheets/"; NSString *spreadsheetId = @"1tJd4toWFxmHAEOeONauRPcuH_rWJOESLQT7TvCIK0x0"; baseUrl= [baseUrl stringByAppendingString:spreadsheetId]; baseUrl = [baseUrl stringByAppendingString:@"/values:batchUpdate/"]; NSMutableDictionary * params=[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"USER_ENTERED",@"valueInputOption", nil]; NSURL *postURL=[GTLUtilities URLWithString:baseUrl queryParameters:params]; NSLog(@"base url is %@", postURL); GTLObject * body=[[GTLObject alloc]init]; NSMutableArray * titleArray=[[NSMutableArray alloc]initWithObjects:@"Customer ID",@"Customer Name",@"Latitude",@"Longitude" ,@"Last_Updated_At",nil]; NSMutableArray * wheelArray2=[[NSMutableArray alloc]initWithObjects:@"rt",@"SHJ",@"150.00",@"100.00",@"2:00:00", nil]; //[contentArray addObject:titleArray]; NSMutableDictionary * batchParams=[[NSMutableDictionary […]
我无法确定如何将file upload到公共访问存储桶到云存储。 我已经build立了一个存储桶,并将其ACL设置为对所有用户进行读取和写入。 我启用了云存储JSON API和云存储API。 我为浏览器应用程序创build了一个允许任何引用者的API密钥。 这是我在Swift中的代码: private lazy var googleServiceStorage:GTLServiceStorage = { var storage = GTLServiceStorage() storage.APIKey = "AIzaSy**********m8TPCM" storage.additionalHTTPHeaders = ["x-goog-project-id" : "159*******7"] return storage }() } public func uploadAssetToGoogle(resourcePath: String?) { if let _resourcePath = resourcePath { let fileHandle = NSFileHandle(forReadingAtPath: _resourcePath) let uploadParams = GTLUploadParameters(fileHandle: fileHandle, MIMEType: "video/mov") var storageObject = […]