ionic-v1.7.12-ios版修改
2016-01-08 13:57
525 查看
1.打开其他应用(window.open(‘xxx://xxx’)),在plist文件添加:
<key>LSApplicationQueriesSchemes</key> <array> <string>com.xxx.otherapp1</string> <string>com.xxx.otherapp2</string> <string>com.xxx.otherapp3</string> </array>
2.让其他应用打开自己,在plist文件添加:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>auth</string> <key>CFBundleURLSchemes</key> <array> <string>com.xxx.myapp</string> </array> </dict> </array>
3.访问非https类网站(ionic-v1.7.12生成的代码中已经包含)
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
4.添加退出指令(zscmd::exitapp),MainViewController.m中shouldStartLoadWithRequest加上
html中使用window.open(“zscmd::exitapp”)退出应用NSString *requestString = [[request URL] absoluteString]; NSArray *components = [requestString componentsSeparatedByString:@"::"]; if (components != nil && [components count] > 0) { NSString *pocotol = [components objectAtIndex:0]; if ([pocotol isEqualToString:@"zscmd"]) { NSString *commandStr = [components objectAtIndex:1]; NSLog(@"commmand:%@", commandStr); if([commandStr isEqualToString:@"exitapp"]){ exit(0); } return NO; } }
相关文章推荐
- Windows上使用ionic开发IOS程序
- iOS视图层次结构
- iosURL字符串的URLencode 和 encodeURIComponent(base64) 去除get时因特殊字符至错
- IOS的处理touch事件处理(按照手指的移动移动一个圆,开发环境用的ios7,storyboard)
- iOS二级tabView,左右两个tableView,点左边,刷新右边
- Xcode7免证书真机调试
- iOS常用第三方框架/库
- HexString类型的颜色的使用
- iOS与js交互之如何执行自定义操作
- iOS利用仿射变换(CGAffineTransform)制作动画效果
- IOS scrollview在开发中遇到的问题。
- iOS中NSFileManager的使用
- iOS中NSdata的使用
- iOS开发知识概览
- scrollView三个基本的属性_contentSize、contentInset和contentOffset
- iOS 缩放等级 Set the Zoom Level of an MKMapView
- 简单的时间段选择控件
- iOS绘图教程
- ios开发的建议学习
- 学习ios一些建议