I am trying to add calendar event in
-(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
based on some data app received for creating a calendar event.
My problem is : the code for creating calendar event runs without any issue but, the event does not shows up on calendar. when i bring the app back to foreground after my "add event" code has executed, I can then see the calendar event added when I press the home button
Also if my code runs 2-3 times when the app is in background, it seems like the event entry stays in "pending" state after code execution and when the app comes into foreground all events are added immediately.
All I have to do is just bring the app in foreground once and then press home button again - now I can see all pending calendar entries which should have been added once the code has executed some time earlier.
Is this known behaviour? could anyone suggest working workaround which does not lead to appstore rejection?
Aucun commentaire:
Enregistrer un commentaire