当用户滑动查看通知并且应用程序位于前台时。我们可以使其转到应用程序中的特定控制器吗?

发布于 2024-12-23 11:28:54 字数 560 浏览 4 评论 0原文

我有一个应用程序,其中推送通知工作正常,但是当用户滑动时我可以让它转到特定的控制器。

如果有人能以正确的方式指导我。 这将是一个很大的帮助。

谢谢

更新

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {


BeepsDetail *objCont = [[BeepsDetail alloc] initWithNibName:@"BeepsDetail" bundle:nil];
objCont.mId =@"1600";
objCont.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[[self navigationController ] pushViewController:objCont animated:YES];

[window addSubview:navigationController.view];  
[objCont release];}

I have an app in which i have push notifications working properly but when a user slides can i make it go to a specific controller.

If anyone could direct me in the right way.
That would be a great help.

Thnx

UPDATED

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {


BeepsDetail *objCont = [[BeepsDetail alloc] initWithNibName:@"BeepsDetail" bundle:nil];
objCont.mId =@"1600";
objCont.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[[self navigationController ] pushViewController:objCont animated:YES];

[window addSubview:navigationController.view];  
[objCont release];}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

司马昭之心 2024-12-30 11:28:54

您的应用程序委托应该实现此方法;

 - (void)application:(UIApplication *)application 
              didReceiveRemoteNotification:(NSDictionary *)userInfo

在这个方法中,您可以做任何您想做的事情,例如实例化视图控制器并将其视图作为子视图添加到主窗口,或者放置模态视图等。

Your app delegate should implement this method;

 - (void)application:(UIApplication *)application 
              didReceiveRemoteNotification:(NSDictionary *)userInfo

Inside this method, you can do whatever you want to, such as instantiate a view controller and add it's view as a subview to the main window, or put up a modal view, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文