J'ai configuré les notifications locales dans l'App Delegate en utilisant ceci :
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UILocalNotification *notification = [[UILocalNotification alloc]init];
[notification setAlertBody:@"Watch the Latest Episode of CCA-TV"];
[notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:5]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[application setScheduledLocalNotifications:[NSArray arrayWithObject:notification]];
}
Lorsque je lance l'application et que je la quitte, je reçois une erreur disant :
2014-06-07 11:14:16.663 CCA-TV[735:149070] Attempting to schedule a local notification <UIConcreteLocalNotification: 0x1c98d9c0>{fire date = Saturday, June 7, 2014 at 11:14:21 Pacific Daylight Time, time zone = America/Los_Angeles (PDT) offset -25200 (Daylight), repeat interval = 0, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Saturday, June 7, 2014 at 11:14:21 Pacific Daylight Time, user info = (null)} with an alert but haven't received permission from the user to display alerts
Comment puis-je obtenir l'autorisation nécessaire pour afficher les alertes ?