iOS Question iEventKit Question - Getting notified of Event Changes


B4X founder
Staff member
Licensed User
Longtime User
refreshSourcesIfNecessary doesn't limit the events to the changed events.

You can use this code to add a listener:
Sub AddListener
   Dim no As NativeObject = store
   Dim nstore As NativeObject = no.GetField("store")
   no = Me
   no.RunMethod("addStoreListener:", Array(nstore))
End Sub

Sub Store_Changed(Notification As Object)
End Sub

#if OBJC
- (void)addStoreListener:(EKEventStore*) store {
   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventStoreChangedNotification:) name:EKEventStoreChangedNotification object:nil];
    NSLog(@"Store listener added");

- (void)eventStoreChangedNotification:(NSNotification *)notification {
    NSLog(@"Event store changed");
   [ raiseEvent:nil event:@"store_changed:" params:@[notification]];
#End If
Upvote 0