我有这个正常的通知警报代码:
- (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];
}
这对我来说效果很好,但是当我点击“详细信息”时,我希望它被重定向到特定页面。相反,这只会重定向到应用程序的主页,我必须点击整个应用程序一直到提醒部分才能查看它。我不确定如何解决它。帮帮我。
谢谢。
最佳答案
您的应用程序委托(delegate)方法 application:didFinishLaunchingWithOptions:
将使用通知负载调用。 Local and Push Notification Programming Guide 中都有详细记录.
关于ios - iPhone 中的通知弹出重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7305598/