0

Is there any method to temporarily disable all local notifications created by an iPhone app? I need to re enable them all with respect to a condition. my requirement is if the user turned off the notification button on my app , then no more notifications is shown.If he turned it on then all notifications should be shown. Any idea?

4

2 に答える 2

1

たとえば、スケジュールされたすべての通知を取得して、共有設定に保存できます。

[[UIApplication sharedApplication]     scheduledLocalNotifications];

次に、すべての通知をキャンセルします。

- (void)cancelLocalNotification:(UILocalNotification *)notification

ユーザーが通知を再度有効にすると、再度スケジュールを変更できます。

于 2013-01-24T11:58:09.597 に答える
0

「cancelAllLocalNotifications」メソッドを使用でき、ユーザーがオンにすると、すべての通知を再度設定できます。

于 2013-01-24T12:09:48.740 に答える