代码之家  ›  专栏  ›  技术社区  ›  Mansi Dobariya

谷歌日历日历列表,事件列表

  •  0
  • Mansi Dobariya  · 技术社区  · 6 年前

    我正在我的一个iOS应用程序中使用GTMAppAuth SignIn进行身份验证。有了这些,我为googlecalendar定义了所有可能的作用域,但仍然得到了以下结果错误。谷歌日历API和CalDAV API在Google控制台上启用,但我仍然不知道为什么会出现此错误。我还为Google API添加了作用域,如下图所示。

    enter image description here

    my code is given below:
    
    
    -(void) fetchCalendarList
     {
        self.calendarList = nil;
        self.calendarListFetchError = nil;
    
        id<GTMFetcherAuthorizationProtocol> authorization =
        [GTMAppAuthFetcherAuthorization authorizationFromKeychainForName:kGTMAppAuthKeychainItemName];
    
        self.calendarService.authorizer = authorization;
        GTLRCalendarService *service = self.calendarService;
    
        GTLRCalendarQuery_CalendarListList *query = [GTLRCalendarQuery_CalendarListList query];
    
    //    query.minAccessRole = kGTLRCalendarMinAccessRoleOwner;
    //  query.minAccessRole = kGTLRCalendarOrderByStartTime;
    
    
        self.calendarListTicket = [service executeQuery:query
                                      completionHandler:^(GTLRServiceTicket *callbackTicket,
                                                          id calendarList,
                                                          NSError *callbackError) {
                                          // Callback
                                          self.calendarList = calendarList;
                                          self.calendarListFetchError = callbackError;
                                          self.calendarListTicket = nil;
                                          [self fetchEvents];
                                      }];
    }
    
     i am getting this error:
    
    Printing description of callbackError:
    Error Domain=com.google.GTLRErrorObjectDomain Code=403 "Insufficient Permission" UserInfo={GTLRStructuredError=GTLRErrorObject 0x1c065adc0: {message:"Insufficient Permission" errors:[1] code:403}, NSLocalizedDescription=Insufficient Permission}
    
    0 回复  |  直到 6 年前