IOS开发者心得

iOS 跳转到自己的app设置页面

2016-02-19  本文已影响1374人  路上的Acmen

跳转到手机里设置

//上面的链接里面有一种方式可以跳到自己的app。也就是下面这种组合

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=Apps&path=Your+App+Display+Name"]];

- (void) openSettingsApp{

NSString *appDisplayName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"prefs:root=Apps&path=%@", appDisplayName]]];

}

//但是尝试未果,反而跳到系统的设置页面。后来找到了下面的方法供参考

NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

[[UIApplication sharedApplication] openURL:appSettings];

上一篇 下一篇

猜你喜欢

热点阅读