我在我的一个iOS应用程序中使用GTMAppAuth登录进行身份验证。这样,我正在定义所有可能的Google日历使用范围,但仍然出现以下错误.Google控制台上启用了Google Calendar API和CalDAV API,但我仍然不知道为什么会收到此错误。我还为Google API添加了范围如下图所示。
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}