根据Google Calendar API文档here
Google日历提供的投放方式包括:弹出窗口。这些是 支持移动平台和Web客户端。
移动平台支持提醒警报弹出窗口,但在创建任何新事件或提取事件时,它不会显示任何警告弹出窗口(提醒)。
我正在使用Google Calendar API v3 for iOS api 如何在我的应用程序中添加类型弹出提醒的支持?
以下是我正在使用的代码,但它没有显示提醒警告弹出窗口
- (void)createEvent
{
NSDate *date = [TDUtils dateByAddingUnit:NSCalendarUnitMinute value:10 toDate:[NSDate date]];
GTLDateTime *startTime = [GTLDateTime dateTimeWithDate:date timeZone:[NSTimeZone systemTimeZone]];
GTLCalendarEventDateTime *start = [[GTLCalendarEventDateTime alloc] init];
[start setDateTime:startTime];
NSDate *edate = [TDUtils dateByAddingUnit:NSCalendarUnitHour value:1 toDate:date];
GTLDateTime *endTime = [GTLDateTime dateTimeWithDate:edate timeZone:[NSTimeZone systemTimeZone]];
GTLCalendarEventDateTime *end = [[GTLCalendarEventDateTime alloc] init];
[end setDateTime:endTime];
GTLCalendarEventReminder *reminder = [[GTLCalendarEventReminder alloc] init];
[reminder setMethod:@"popup"];
[reminder setMinutes:[NSNumber numberWithInt:2]];
GTLCalendarEventReminders *reminders = [[GTLCalendarEventReminders alloc] init];
[reminders setUseDefault:[NSNumber numberWithBool:NO]];
[reminders setOverrides:@[reminder]];
GTLCalendarEvent *event = [[GTLCalendarEvent alloc] init];
[event setSummary:@"test reminder"];
[event setLocation:@"New delhi"];
[event setDescriptionProperty:@"event description"];
[event setStart:start];
[event setEnd:end];
[event setReminders:reminders];
GTLQueryCalendar *query = [GTLQueryCalendar queryForEventsInsertWithObject:event calendarId:self.calendarID];
[self.service executeQuery:query
completionHandler:^(GTLServiceTicket *ticket, GTLCalendarEvent* object, NSError *error)
{
if (error) {
NSLog(@"Error create event: %@(%ld)", error.localizedDescription, (long)error.code);
}else{
NSLog(@"success: %@", object.JSONString);
}
}];
}