首页 文章

谷歌 Cloud 存储JSON上传器api显示错误

提问于
浏览
0

我正在使用谷歌 Cloud 上传器(https://developers.google.com/storage/docs/json_api/v1/how-tos/upload)API从IOS上传图像 .

我有以下代码 . 对于REST管理器我从这里使用代码https://github.com/SSamanta/SSRestClient

+(void)uploadData:(NSData *)data withName:(NSString *)name onCompletion:(ServiceCompletionHandler)handler {
    SSRestManager *restManager = [[SSRestManager alloc] init];
    restManager.httpMethod = @"POST";
    restManager.contentType = @"image/jpeg";
    restManager.contentLength = [NSString stringWithFormat:@"%i",data.length];
    restManager.httpBody = data;
    NSString *urlString = [NSString stringWithFormat:@"https://www.googleapis.com/upload/storage/v1beta2/b/videosbetas/o?uploadType=media&name=myObject&key=%@",kAPIKey];
    [restManager getHttpResponseWithBaseUrl:urlString onCompletion:^(id responseData, NSURLResponse *reponse) {
        if (responseData) {
            handler (responseData,nil);
        }
    } onError:^(NSError *error) {
        handler(nil,error);
    }];
}

我收到来自谷歌 Cloud 存储API的以下错误消息 . 我已按照所有说明在Google开发者控制台中配置应用 .

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],
  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }

谁能帮我?

1 回答

相关问题