//跳转到本项目设置相关 oc
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if([[UIApplication sharedApplication]canOpenURL:url]) {
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) {
}];
} else {
[KPToast showToastWithMessage:@"请到系统设置中,打开App推送开关"];
}
}
//跳转到本项目设置相关 swift
if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
// Fallback on earlier versions
}
}