iOS开发app间相互跳转以及appStore和系统设置
来源:互联网 发布:决战武林神翼进阶数据 编辑:程序博客网 时间:2024/05/07 07:01
1.app间相互跳转
(1)两个项目,这里我们暂且说项目A和项目B。
(2)项目A跳转到项目B。
步骤1:打开项目B工程 找到info 目录下的URL Types,点击+号进行添加,然后设置URL schemes。
(3)将项目B的URL schemes 记录下来,以便在项目A中使用。
(5)当然,如果你想在A跳转到B的时候,从项目A传给一些值给B,请坐如下操作:
2.app跳到系统设置界面
(1)两个项目,这里我们暂且说项目A和项目B。
(2)项目A跳转到项目B。
步骤1:打开项目B工程 找到info 目录下的URL Types,点击+号进行添加,然后设置URL schemes。
(3)将项目B的URL schemes 记录下来,以便在项目A中使用。
如图:
(4)回到项目A,在你需要跳转的地方写上:
</pre><p><pre name="code" class="objc"> NSURL *url = [NSURL URLWithString:@"qiyuanmall://"]; // 这里的qiyuanmall://" 你就可以替换成你在B项目的URL Schemes的值然后在后面加上@"://"// 如果已经安装了这个应用,就跳转
if ([[UIApplication sharedApplication] canOpenURL:url]) { [[UIApplication sharedApplication] openURL:url]; }else{ NSURL *appStore = [NSURL URLWithString:@"您app的appStore地址"];// 跳到APPStore [[UIApplication sharedApplication] openURL:appStore]; }
(5)当然,如果你想在A跳转到B的时候,从项目A传给一些值给B,请坐如下操作:
NSURL *url = [NSURL URLWithString:@"qiyuanmall://"]; 请注意这里 eg:把@"qiyuanmall://换成[NSString stringWithFormat:@"qiyuanmall://username=%@&age=%@&address=%@", @"test123", @"100", @"上海市"];(6)在项目B中接受到A传的值,在APPDelegate中找到OpenURL
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ NSString *urlStr = [url absoluteString]; if ([urlStr hasPrefix:@"qiyuanmall://"]) { NSLog(@"TestAppDemo1 request params: %@", urlStr); urlStr = [urlStr stringByReplacingOccurrencesOfString:@"qiyuanmall://" withString:@""]; NSArray *paramArray = [urlStr componentsSeparatedByString:@"&"]; NSLog(@"paramArray: %@", paramArray); NSMutableDictionary *paramsDic = [[NSMutableDictionary alloc] initWithCapacity:0]; for (int i = 0; i < paramArray.count; i++) { NSString *str = paramArray[i]; NSArray *keyArray = [str componentsSeparatedByString:@"="]; NSString *key = keyArray[0]; NSString *value = keyArray[1]; [paramsDic setObject:value forKey:key]; NSLog(@"key:%@ ==== value:%@", key, value); } } return NO;}
[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]]; [[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General&path=Restrictions"]];一些其他可用的参数:List of currently known URLs in the Settings app:prefs:root=General&path=About //关于prefs:root=General&path=ACCESSIBILITY//重力感应 prefs:root=AIRPLANE_MODE//飞行模式prefs:root=General&path=AUTOLOCK//自动锁定prefs:root=General&path=USAGE/CELLULAR_USAGE//用量prefs:root=Brightness//亮度调节prefs:root=General&path=Bluetooth//蓝牙prefs:root=General&path=DATE_AND_TIME//时间和日期prefs:root=FACETIME//prefs:root=General//通用prefs:root=General&path=Keyboard//键盘prefs:root=CASTLE//prefs:root=CASTLE&path=STORAGE_AND_BACKUP//prefs:root=General&path=INTERNATIONAL//prefs:root=LOCATION_SERVICES//prefs:root=ACCOUNT_SETTINGS//prefs:root=MUSIC//prefs:root=MUSIC&path=EQ//prefs:root=MUSIC&path=VolumeLimit//prefs:root=General&path=Network//prefs:root=NIKE_PLUS_IPOD//prefs:root=NOTES//prefs:root=NOTIFICATIONS_ID//prefs:root=Phone//prefs:root=Photos//prefs:root=General&path=ManagedConfigurationList//prefs:root=General&path=Reset//prefs:root=Sounds&path=Ringtone//prefs:root=Safari//prefs:root=General&path=Assistant//prefs:root=Sounds//prefs:root=General&path=SOFTWARE_UPDATE_LINK//prefs:root=STORE//prefs:root=TWITTER//prefs:root=General&path=USAGE//prefs:root=VIDEO//prefs:root=General&path=Network/VPN//prefs:root=Wallpaper//prefs:root=WIFI//prefs:root=INTERNET_TETHERING//
0 0
- iOS开发app间相互跳转以及appStore和系统设置
- iOS开发之app之间的跳转以及跳转到appstore
- iOS开发之app之间的跳转以及跳转到appstore
- iOS App 跳转到 AppStore
- iOS App 跳转到 AppStore
- iOS开发 跳转到系统对应app设置(ios8)
- iOS开发之App如何跳转到系统设置界面
- IOS开发—跳转到系统设置以及其他应用
- ios app间的相互跳转
- [IOS] App内跳转到系统设置
- iOS App跳转到系统设置页面
- iOS App跳转到系统设置页面
- iOS小demo之跳转系统页面和APPStore
- ios上跳转app的方法,跳转到appstore等系统应用的方法
- ios上跳转app的方法,跳转到appstore等系统应用的方法
- iOS app应用 跳转appStore评分 1
- iOS app应用 跳转appStore评分 2
- ios------app跳转到appStore评分
- 录屏软件bandicam
- CSS基础
- AsyncTask结合HttpHrlConnection的例子
- 【leetcode】Remove Duplicates from sorted array
- Oracle linux内核参数设置详解
- iOS开发app间相互跳转以及appStore和系统设置
- Android中Java和JavaScript交互
- java中利用正则,过滤网页标签.......
- android studio连接不上手机的解决办法
- 字符串的匹配--朴素
- 常用的Linux命令
- Android系统自带的Dialog
- 【华为 OJ】 名字的漂亮度
- [iOS]把agent权限指定给开发组的其他成员