Notification pop-up redirection iPhone
-
25-10-2019 - |
Question
J'ai ce code normal pour recevoir une alerte de notification:
- (void)saveNotification {
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [[datePicker date] dateByAddingTimeInterval:-20];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Evaluation Planner";
notif.alertAction = @"Details";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
NSDictionary *userDict = [NSDictionary dictionaryWithObject:reminderText.text
forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
}
}
- (void)showReminder:(NSString *)text {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder"
message:text delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
}
Cela fonctionne parfaitement bien pour moi, mais quand je clique sur « Détails », je veux qu'il soit redirigé vers une page particulière. Au lieu de cette redirection uniquement sur la page principale de l'application et je dois cliquer sur l'application entière tout le chemin à la section de rappel pour la voir. Je ne suis pas sûr de savoir comment le fixer. Faites-moi l'aide.
Merci.
La solution
Votre délégué app méthode application:didFinishLaunchingWithOptions:
sera appelé avec une charge utile de notification. Tout est bien documenté dans local et notification Push Programmation Guide.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow