J'utilise la notification UIlocal sur ma réponse du serveur, Quand je cours l'application sur le simulateur montre la notification dans ma zone de notification de l'image envoyée au serveur, mais quand vous exécutez la même application sur le vrai appareil il ne montre rien dans ma zone de notification, le code est bien mais je ne comprends pas pourquoi il ne montre rien, s'il vous plaît aidez-moi. Mon code estUIlocalNotification pas vu dans le vrai périphérique dans IOS
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = res;
localNotification.alertBody = @"Image Sent";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
et dans mon dossier AppDelegate.m il est écrit comme cela,
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{
NSLog(@"User Info : %@",notification.request.content.userInfo);
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);}
et quand je lance l'application sur le simulateur, il montre comme ça, mais quand je lance sur réel appareil, il montre rien de tel
Avez-vous autorisé les notifications sur votre appareil? –
êtes-vous inscrit au programme de développement des pommes (99 $ par année)? –
oui quand j'ai ouvert la première fois l'application sur mon appareil, il a demandé la permission. @ АлександрКолесник – Oneeb