推送在未启动程序的情况下怎么跳转到相应的页面。不多说直接上代码。- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{/*** 判断是否是通过推送进入程序 并进行处理*/NSDictionary *dic=[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];NSLog(@"not===%@",dic);if (dic) {isPush=YES;NSString *typle=[NSString stringWithFormat:@"%@",dic[@"aps"][@"typle"]];[UIAlert pushAlert:typle confirm:^{[self postRemoteNotificationTyple:typle AndUserInfo:dic];}];}return YES;}//发送通知- (void)postRemoteNotificationTyple:(NSString *)typle AndUserInfo:(NSDictionary *)userInfo{if ([typle isEqualToString:@"1"]) {[[NSNotificationCenter defaultCenter]postNotificationName:@"toHouseList" object:nil userInfo:userInfo];}else if([typle isEqualToString:@"2"]){[[NSNotificationCenter defaultCenter]postNotificationName:@"toHouse" object:nil userInfo:userInfo];}else if([typle isEqualToString:@"3"]){[[NSNotificationCenter defaultCenter]postNotificationName:@"toWebView" object:nil userInfo:userInfo];}}//在首页接收通知并执行跳转即可
ios推送 程序未启动,收到推送消息,打开应用后跳转到相应的活动页面的代码。
最新推荐文章于 2026-03-10 04:35:19 发布
本文介绍了一种在iOS应用中实现从推送消息直接跳转到指定页面的方法。通过监听推送消息中的特定类型字段,可以利用NSNotification来触发不同类型的页面跳转。
1万+

被折叠的 条评论
为什么被折叠?



