我正在將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