iOS评分功能、APP中打开其他应用程序
2015-06-21 16:43
381 查看
1、评分功能
iOS中评分支持功能开发非常简单。
2、打开其他应用程序
在程序中打开其他应用程序,需要先设置被打开应用的scheme。
例如我们在自己做的APP 1中设置scheme,设置方法如下:
然后在自己的APP 2中添加代码:
判断本地是否安装要打开的应用:[app canOpenURL:url]
iOS中评分支持功能开发非常简单。
NSString *str = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/cn/app/id%@?mt=8", appid]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];只需要这么两行就可以啦,它就会跳转到AppStore的应用位置去咯。
2、打开其他应用程序
在程序中打开其他应用程序,需要先设置被打开应用的scheme。
例如我们在自己做的APP 1中设置scheme,设置方法如下:
然后在自己的APP 2中添加代码:
// 1.根据模型拼接url //"scheme://identifier" NSString *path = [NSString stringWithFormat:@"%@://%@", product.scheme, product.identifier]; NSURL *url = [NSURL URLWithString:path]; // 2.判断能否打开应用 UIApplication *app = [UIApplication sharedApplication]; if ([app canOpenURL:url]) { // 2.打开应用程序 [app openURL:url]; }else { // 没有安装应用程序就跳转到AppStore [[UIApplication sharedApplication] openURL:[NSURL URLWithString: product.url]]; }
判断本地是否安装要打开的应用:[app canOpenURL:url]
相关文章推荐
- 对android中ActionBar中setDisplayHomeAsUpEnabled和setHomeButtonEnabled和setDisplayShowHomeEnabled方法的理解
- android在Canvas使用drawBitmap画一幅画
- Java Card Applet Development——环境搭建及基础概念
- Android Studio开发第三篇版本管理Git
- iOS中block深入原理研究
- UIWebView
- iOS学习009
- Android计时器
- swift 传值 引用 (=、&)
- cocos2d-js学习笔记---场景转换(scene),颜色图层,变量获得
- AndroidPN的学习研究(一)环境建立
- 一步步走进Android MaterialDesign 之 ToolBar动画效果(2)
- object sender,EventArgs e .
- Android事件传递机制【Touch事件】
- swift operator+()
- Android事件传递机制【按键事件】
- 详解——android系统软键盘的手动显示和隐藏
- Android开发通过adapter显示listview
- IOS 分享学习笔记
- Android开发中执行方法中含有监听时的处理