EKEventStore is not work

use electron mac I want use EKEventStore to Add calendar in meeting_premeeting_servire.mm
I write like this but no work (the function can use ,I can print calendar)

#import <EventKit/EventKit.h>
//添加日历
int ZPremeetingServiceWrap::addCalendarItem(ZNCalendarItem calendarItem){
     NSLog(@"events:<<<<<<<<<<<< >>>>>>>>>>>");
    NSCalendar *calendar = [NSCalendar currentCalendar];
    EKEventStore *eventStore = [[EKEventStore alloc] init];
    std::cout << "=====33333======="<<calendar<< std::endl;
     std::cout << "=====13214312======="<<eventStore<< std::endl;
  // 获取日历添加状态
  EKAuthorizationStatus EKstatus = [EKEventStore authorizationStatusForEntityType: (EKEntityTypeEvent)];
  if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]){
    std::cout << "=====0000000======="<< std::endl;  
  }
    std::cout << "=====44444======="<<EKstatus<< std::endl;
 
   if(EKstatus == 3){
       std::cout << "=====44444Restricted======="<< std::endl;
  
    EKEvent *event = [EKEvent eventWithEventStore:eventStore];
       /** 向日历添加一个事件
     * title  事件标题
     * notes  事件备注
     * location 事件地址
     * startDate 开始日期
     * endDate  结束日期
     * alarms 闹钟
     * availability 事件调度
     */
    
    event.title = @"title";
//    event.location = location;
    
    //[NSDate dateWithTimeIntervalSinceNow:10];
    //[NSDate dateWithTimeIntervalSinceNow:20];
    
    NSDate *startDate = [NSDate dateWithTimeIntervalSinceNow:10];
    NSDate *endDate = [NSDate dateWithTimeIntervalSinceNow:20];
    
    //设定事件开始时间
    event.startDate = startDate;
    //设定事件结束时间
    event.endDate=endDate;
    
    //添加提醒 可以添加多个,设定事件多久以前开始提醒
    //event.allDay = YES;
    
    //在事件前多少秒开始事件提醒 -5.0f
    EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-5.f];
    [event addAlarm:alarm];
    
    [event setCalendar:[eventStore defaultCalendarForNewEvents]];
    
    NSError *error;
     [eventStore saveEvent:event span:EKSpanThisEvent commit:YES error:&error];
   
   
    return 1;
   }else if (EKstatus == 0){
      if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]){
  
  } 
    std::cout << "=====777777Restricted======="<< std::endl;  
    EKEventStore *eventStore = [[EKEventStore alloc] init];
    
     std::cout << "=====777777Restricted======="<<eventStore<< std::endl; 
      [[[EKEventStore alloc]init] requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError * _Nullable error) {
              std::cout << "=====9999999888Restricted======="<< std::endl; 
            if(granted){
               
            }else{ 
             
         }
    }];
   
   }else{
          NSLog(@"Authorized111111111");
       
   }
}

Hi wangh,

Thanks for the post. It seems like you are changing our Electron SDK directly. Unfortunately we are not able to provide support on the interfaces or the methods that we do not expose to the public. Thank you for your understanding.

Thanks!