简体   繁体   English

iPhone中的通知弹出重定向

[英]Notification pop-up redirection in iPhone

I have this normal code for notification alert: 我有通知警报的正常代码:

- (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];
}

This works perfectly well for me but when I click onto "Details", I want it to be redirected to a particular page. 这对我来说效果非常好,但当我点击“详细信息”时,我希望将其重定向到特定页面。 Instead this only redirect to the main page of the application and I have to click through the whole app all the way to the reminder section to view it. 相反,这只会重定向到应用程序的主页面,我必须点击整个应用程序一直到提醒部分才能查看它。 I'm not exactly sure how to fix it. 我不确定如何解决它。 Do help me. 帮帮我

Thanks. 谢谢。

Your app delegate method application:didFinishLaunchingWithOptions: will get called with a notification payload. 你的app delegate方法application:didFinishLaunchingWithOptions:将通过通知有效负载调用。 It's all documented well in Local and Push Notification Programming Guide . 本地和推送通知编程指南中都记录了这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM