当iOS中的应用程序从设备中删除时,如何删除我的应用程序日历的所有事件 [英] How to delete all the Events of My App Calendar when app is deleted from device in iOS

查看:204
本文介绍了当iOS中的应用程序从设备中删除时,如何删除我的应用程序日历的所有事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为MyCalendar的日历。



我已将一些活动存储到该日历中。



我知道如何从日历中删除所有事件。

  NSDate * startDate = [NSDate date]; 
NSDate * endDate = [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
NSArray * calendarArray = [NSArray arrayWithObject:self.defaultCalendar];

NSPredicate * predicate = [self.eventStore predicateForEventsWithStartDate:startDate
endDate:endDate
calendars:calendarArray];

NSArray * events = [self.eventStore eventsMatchingPredicate:predicate];

for(EKEvent * event in events){
NSError * err = nil;
[self.eventStore removeEvent:event span:EKSpanFutureEvents commit:YES error:& err];

}

但是当用户从设备中删除了我的应用程序。如何删除与Google日历MyCalendar相关的所有活动。



由于不必要,已删除的应用程式的一些活动仍然存在于装置日历中。



如果用户不想使用我的应用程序,最好保留与我的应用程序相关的事件。



任何想法&

解决方案


< >

这是很直接,我们没有任何控制,当用户要删除应用程序从iPhone做一些行动。您可以在应用程序中提供删除所有事件选项,以通知用户正确的按摩。我认为用户至少单次使用您的应用程序,然后再删除。所以我想如果他/她有正确的想法,如何这个应用程序是工作,然后蔑视他们可以删除应用程序事件,然后删除应用程序。



实际上,我们没有任何选项,为什么我会建议你这一个。



实际上天气苹果处理这样的功能或不是由他们。因为一些时间事件不只是相关的应用程序,从添加生日事件从facebook不只是与facebook相关。用户需要提醒即使Facebook应用程序被删除。所以我认为苹果需要找出一些解决方案来处理这种情况。



希望这有助于你。


I am having a calendar with name MyCalendar.

I have stored some events to that calendar..

I know how to delete all the events from the calendar..as below

NSDate *startDate = [NSDate date];
NSDate* endDate =  [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
NSArray *calendarArray = [NSArray arrayWithObject:self.defaultCalendar];

NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate
                                                                              endDate:endDate
                                                                            calendars:calendarArray];

NSArray *events = [self.eventStore eventsMatchingPredicate:predicate];

for (EKEvent *event in events) {
   NSError* err = nil;
   [self.eventStore removeEvent:event span:EKSpanFutureEvents commit:YES error:&err];

}

But when user deleted my app from device. How can I delete all the events related to Calendar MyCalendar.

As unnecessary some events of the deleted app still exists at device calendar.

It is worst to keep events related to My App if user don't want to use My App..

Any Ideas & Suggestions are appreciated..Is it possible?

Thanks in Advance..

解决方案

It is pretty straightforward that we don't have any control to do some action when user is going to delete application from iPhone. May be you can provide Delete All Events option inside application to notify user with proper massage. i think user at least single time used your application before deleting. so i think if he/she has proper idea of how this app is working then defiantly they can delete app events from application and then deleting app.

Actually we don't have any option that why i would suggest you this one. what so amount of user taking advantage of this option will helpful for them.

Actually weather apple handle such functionality or not it up to them. because some time events is not just related to app like Adding birthday event from facebook is not just related to facebook. user need that reminder even though facebook app is deleted. so i think apple need to figure out certain solution from handling such situation.

Hope this help you.

这篇关于当iOS中的应用程序从设备中删除时,如何删除我的应用程序日历的所有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆