// iOS调用 AlipaySDK 支付宝找不到头文件<openssl/rsa.h>
首先将 openssl 和 Util 目录添加到Build setting->header search path 中 ($(PROJECT_DIR)/SXH/Vendor/AlipaySDK)
添加 AlipaySDK 的库和 framework (添加的内容可以查看 AlipaySDKDEMO )
//运行后报错,类似于以下提示信息:
Cannot find interface declaration for 'NSObject', superclass of 'Base64'
//解决
那么需要打开报错了的文件,增加头文件。
#import <Foundation/Foundation.h>
//Undefined symbols for architecture x86_64:
//解决
在 Build Phases -> Link Binary With Libraries 中新增 'SystemConfiguration.framework'
//跳转支付宝 APP 客户端返回后弹出 web 登录页面
//解决
在项目中加上 Main.storyboard ,Info.plist 中加上 Main storyboard file base name -> Main
ps: 在 IOS 的开发中最好加上 LaunchScreen 和 Main.storyboard ,不然在引用一些第三方的库时,可能会出现一些奇怪的问题和现象,难以排查。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | // 判断客服端有没有安装支付宝 // NSURL * myURL_APP_A = [NSURL URLWithString:@"alipay:"]; // if (![[UIApplication sharedApplication] canOpenURL:myURL_APP_A]) { // //如果没有安装支付宝客户端那么需要安装 // UIAlertView *message = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"您还没有安装支付宝钱包!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil]; // [message show]; // return; // } //判断客服端有没有安装支付宝,没有跳转 web // NSArray *array = [[UIApplication sharedApplication] windows]; // UIWindow* win=[array objectAtIndex:0]; // [win setHidden:NO]; // //跳转 AppStore 下载支付宝 // NSString * URLString = @"http://itunes.apple.com/cn/app/id535715926?mt=8"; // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString]]; |
联系客服