我正在将Google日历集成到我的应用程序中。它已成功集成,现在我想将用户事件添加到Google日历。如果我在Google日历中添加用户事件,则该事件应该反映在jSon响应中。如何在iOS中的Google日历中添加用户事件
我有问题在json响应中获取用户事件。
-(void)updateCalendar
{
//NSString *calendarId = @"XXXX-fr62agepgso9n50s9nhv7c2g27inhqg6.apps.googleusercontent.com";
NSString *calendarId = @"[email protected]";
NSString *apiKey = @"XXX";
NSString *urlFormat = @"https://www.googleapis.com/calendar/v3/calendars/%@/events?key=%@&fields=items(id,start,summary,status)";
NSString *calendarUrl = [NSString stringWithFormat:urlFormat, calendarId, apiKey];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
[manager GET:calendarUrl parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject)
{
[ADManagedObjectContext updateEvents:responseObject[@"items"]];
[self.refreshControl endRefreshing];
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
[self.refreshControl endRefreshing];
}];
}
@Dalm为了帮助我,如果你有任何想法PLZ。帮助我的任何机构 – satya
您是否尝试过https://developers.google.com/google-apps/calendar/quickstart/ios? – luc
@luc感谢您的回复。我跟着这个教程..https://github.com/theandrewdavis/ios-google-calendar ..但我想在谷歌日历添加事件..接下来相关的添加事件应该反映在我的JSON响应 – satya