QQ 微信 新浪 无法 分享 收集
2015-10-09 19:31
531 查看
1.网络请求报错。
升级
输出错误信息
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
原因:iOS9引入了新特性
详情:App Transport Security (ATS)
新特性要求App内访问的网络必须使用
但是现在公司的项目使用的是
最终找到以下解决办法:
在Info.plist中添加
在
2.Scheme白名单问题(无法判断手机是否安装微信等)
-canOpenURL: failed for URL: "weixin://app/wxdaae92a9cfe5d54c/" - error: "This app is not allowed to query for scheme weixin"
搜索后得知
近期苹果公司iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
![](http://img.blog.csdn.net/20150917161601220)
注意:截图来自微信开放平台,里面已经包含第一个问题的解决
完成后需使用Xcode 7编译。
如果你在模拟器上运行可以能还会有以下报错:
-canOpenURL: failed for URL: "weixin://app/wxdaae92a9cfe5d54c/" - error: "(null)"
这是因为模拟器上并没有安装微信,如果运行到真机上就不会有报错了。
请注意:未升级到微信客户端6.2.5及以上版本的用户,在iOS 9下使用到微信相关功能时,仍可能无法成功。
下面整理一些常用的白名单
qq登录绑定,qq支付,qq分享
微信支付,微信登录绑定
新浪登录绑定
支付宝支付,支付宝登录绑定
3.Bitcode问题(通俗解释:在线版安卓ART模式)
报错如下
ld: warning: directory not found for option ‘-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks‘
ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)
![](http://img.blog.csdn.net/20150918104229291)
Bitcode报错
原因:Xcode7 及以上版本会默认开启 bitcode 。
bitcode具体是什么就不解释了。
解决方法:
1.更新library使包含Bitcode,否则会出现以上的警告。
2.关闭Bitcode,简单粗暴。
Build Settings”->”Enable Bitcode”改成"NO"。
![](http://img.blog.csdn.net/20150918104604124)
4.项目运行报错如下
出错原因:设置app的状态栏样式的使用使用了旧的方式,在info.plist里面设置了View controller-based status bar appearance为NO,默认为YES,一般式iOS6的时候使用这种方式,iOS7,8也兼容,但是到了iOS9就报了警告。
以前我们通过上面代码改变状态了颜色,iOS9以后点进去看api发现如下说明
解决办法:
修改方式将View controller-based status bar appearance设置为YES,然后使用新的方式来实现状态栏的样式。
2015.09.21更新
5 directory not found for option问题
警告如下:
ld: warning: directory not found for option ‘-F/Applications/Xcode 7.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks‘
问题原因:Xcode7将framworks位置改变了。
解决方法:
点击项目,选择 Targets->xxxTests
选择build setting ,找到 Frameworks Search Path 或者 Library Search Paths
删除$(SDKROOT)/Developer/Library/Frameworks,
或者使用$(PLATFORM_DIR)/Developer/Library/Frameworks替换
![](http://img.blog.csdn.net/20150921153754726)
framworks位置改变
暂时就这些,还有其他问题会继续更新
升级
Xcode 7.0发现网络访问失败。
输出错误信息
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
原因:iOS9引入了新特性
App Transport Security (ATS)。
详情:App Transport Security (ATS)
新特性要求App内访问的网络必须使用
HTTPS协议。
但是现在公司的项目使用的是
HTTP协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS协议传输。
最终找到以下解决办法:
在Info.plist中添加
NSAppTransportSecurity类型
Dictionary。
在
NSAppTransportSecurity下添加
NSAllowsArbitraryLoads类型
Boolean,值设为
YES
2.Scheme白名单问题(无法判断手机是否安装微信等)
-canOpenURL: failed for URL: "weixin://app/wxdaae92a9cfe5d54c/" - error: "This app is not allowed to query for scheme weixin"
搜索后得知
近期苹果公司iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
注意:截图来自微信开放平台,里面已经包含第一个问题的解决
完成后需使用Xcode 7编译。
如果你在模拟器上运行可以能还会有以下报错:
-canOpenURL: failed for URL: "weixin://app/wxdaae92a9cfe5d54c/" - error: "(null)"
这是因为模拟器上并没有安装微信,如果运行到真机上就不会有报错了。
请注意:未升级到微信客户端6.2.5及以上版本的用户,在iOS 9下使用到微信相关功能时,仍可能无法成功。
下面整理一些常用的白名单
<key>LSApplicationQueriesSchemes</key> <array> <string>mqqOpensdkSSoLogin</string> <string>mqzone</string> <string>sinaweibo</string> <string>alipayauth</string> <string>alipay</string> <string>safepay</string> <string>mqq</string> <string>mqqapi</string> <string>mqqopensdkapiV3</string> <string>mqqopensdkapiV2</string> <string>mqqapiwallet</string> <string>mqqwpa</string> <string>mqqbrowser</string> <string>wtloginmqq2</string> <string>weixin</string> <string>wechat</string> </array>
qq登录绑定,qq支付,qq分享
微信支付,微信登录绑定
新浪登录绑定
支付宝支付,支付宝登录绑定
3.Bitcode问题(通俗解释:在线版安卓ART模式)
报错如下
ld: warning: directory not found for option ‘-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks‘
ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Bitcode报错
原因:Xcode7 及以上版本会默认开启 bitcode 。
bitcode具体是什么就不解释了。
解决方法:
1.更新library使包含Bitcode,否则会出现以上的警告。
2.关闭Bitcode,简单粗暴。
Build Settings”->”Enable Bitcode”改成"NO"。
4.项目运行报错如下
<Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
出错原因:设置app的状态栏样式的使用使用了旧的方式,在info.plist里面设置了View controller-based status bar appearance为NO,默认为YES,一般式iOS6的时候使用这种方式,iOS7,8也兼容,但是到了iOS9就报了警告。
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
以前我们通过上面代码改变状态了颜色,iOS9以后点进去看api发现如下说明
// Setting the statusBarStyle does nothing if your application is using the default UIViewController-based status bar system. @property(readwrite, nonatomic) UIStatusBarStyle statusBarStyle NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]"); - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]");
解决办法:
修改方式将View controller-based status bar appearance设置为YES,然后使用新的方式来实现状态栏的样式。
- (UIStatusBarStyle)preferredStatusBarStyle; - (UIViewController *)childViewControllerForStatusBarStyle; - (void)setNeedsStatusBarAppearanceUpdate
2015.09.21更新
5 directory not found for option问题
警告如下:
ld: warning: directory not found for option ‘-F/Applications/Xcode 7.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks‘
问题原因:Xcode7将framworks位置改变了。
解决方法:
点击项目,选择 Targets->xxxTests
选择build setting ,找到 Frameworks Search Path 或者 Library Search Paths
删除$(SDKROOT)/Developer/Library/Frameworks,
或者使用$(PLATFORM_DIR)/Developer/Library/Frameworks替换
framworks位置改变
暂时就这些,还有其他问题会继续更新
相关文章推荐
- QQ,微博,微信链接分享无法显示分享记录
- iOS第三方支付集成——微信支付
- 微信开发中踩过的坑
- 微信扫码支付.net版本
- 【微信转发,学院送礼】动动手指,分享课程,轻松领大奖~
- 模拟微信发送文件给好友/群
- 用document.title=“xxx”动态修改title,在ios的微信下面不生效的解决办法!
- JAVA模拟微信消息发送请求
- iOS 支付 [支付宝、银联、微信]
- [转]来自微信团队的Apk瘦身经验
- 微信插件数据获取失败的解决方案
- 微信自定义菜单的创建(JAVA版)
- iOS9下关于微信与支付宝支付不能跳转问题的解决
- 微信支付 for android 集成笔记( 集成遇到问题记录)
- 教你用PS给你的室友做一套动态微信豪华表情包
- 微信浏览器取消缓存的方法
- C#开发微信门户及应用(8)-微信门户应用管理系统功能介绍
- 怎么拿到微信视频文件
- C#开发微信门户及应用(6)--微信门户菜单的管理操作
- C#开发微信门户及应用(7)-微信多客服功能及开发集成