Kann jemand bitte einen Blick auf den folgenden Code und sagen Sie mir, warum die lokale Benachrichtigung nicht feuert. Ich führe die App in XCode aus und verwende die Debug-Option, um einen Hintergrundabruf zu simulieren, aber die lokale Benachrichtigung wird nicht ausgelöst.Lokale Benachrichtigung nicht mit Hintergrund Fetch
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
NSLog(@"performFetchWithCompletionHandler");
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif) {
localNotif.alertBody = @"Update demo text!";
localNotif.alertAction = @"OK";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.fireDate = nil;
NSLog(@"Local Notification");
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
}
//Perform some operation
completionHandler(UIBackgroundFetchResultNewData);
}
Ahh ich nicht, dass es sein könnte. – ORStudios
Perfekt, das war das Problem. Vielen Dank – ORStudios