您的位置:首页 > 移动开发 > IOS开发

iOS开发关于远程推送页面跳转

2016-01-21 15:03 676 查看
在AppDelegate 里面解析推送信息,以及转跳界面

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler

{



// NSError *parseError = nil;

// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo

// options:NSJSONWritingPrettyPrinted error:&parseError];

// NSString *str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"apns.content", @"Apns content")

// message:str

// delegate:nil

// cancelButtonTitle:NSLocalizedString(@"ok", @"OK")

// otherButtonTitles:nil];

// [alert show];



NSString * type = [userInfo objectForKey:@"f"];

if (application.applicationState == UIApplicationStateActive) {



}

else if(application.applicationState == UIApplicationStateInactive){



[self performSelector:@selector(pushViewAction:) withObject:type afterDelay:0.1];

}



}

- (void)pushViewAction:(NSString *)type{



if (mianController) {



[mianController
notificationPush:type];

}



}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: