Objective-C: Annoying - I get about 5-6 Notifications per minute from my UILocalNotifications
<p>How to fix this issue?
This is my code: </p>

<pre><code>NSDate *dateToSet = [NSDate dateWithTimeIntervalSinceNow:1.0];
NSString *message = @"Test notification";
UILocalNotification *warningNotification = [[UILocalNotification alloc] init];
warningNotification.fireDate = dateToSet;
warningNotification.timeZone = [NSTimeZone defaultTimeZone];
warningNotification.alertBody = message;
warningNotification.hasAction = NO;
warningNotification.userInfo = nil;
warningNotification.repeatInterval = NSCalendarUnitDay;
warningNotification.soundName = nil;
[[UIApplication sharedApplication] scheduleLocalNotification:warningNotification];
</code></pre>

<p>And my AppDelegate.m (didFinishLaunchingWithOptions):</p>

<pre><code>UIUserNotificationType types = UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];

if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]){
    [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:nil]];
}

[[UIApplication sharedApplication] scheduledLocalNotifications];
[application registerForRemoteNotifications];
</code></pre>

<p><a href="https://i.stack.imgur.com/jrBpQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jrBpQ.png" alt="enter image description here"></a></p>