推送在未启动程序的情况下怎么跳转到相应的页面。不多说直接上代码。- (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推送 程序未启动,收到推送消息,打开应用后跳转到相应的活动页面的代码。
最新推荐文章于 2018-03-21 13:20:48 发布