一.直接 H5方式支付, 用戶需要輸入賬號, 手動返回App, 且有的無返回(需要殺死 App), 也無法攔截添加 , 體驗最差, 蘋果審核通過率最高
二.白名單方式, h5界面調(diào)用支付寶的客戶端, 用戶手動返回App, 且有的無返回(需要殺死 App), 但是可以攔截添加返回, 體驗還好, 蘋果審核通過率高
三.h5界面, 調(diào)用支付寶的客戶端, 需要用到支付寶 SDK, 接入流程簡單, 代碼簡單, 體驗很好, 但是蘋果機審和人工審核都過不了
四.原生的 App 調(diào)用支付寶的客戶端, 需要用到支付寶 SDK, 接入流程簡單, 代碼簡單, 體驗完美, 但是蘋果機審和人工審核都過不了, 體驗最流暢的方式(本次未開發(fā))
下面針對前三種實現(xiàn)方式進行總結:
1.后臺給的 H5界面, url 傳入, webView 加載, 大膽的跑吧, 能走到哪里就走到哪里
2.后臺給的 H5界面, url 傳入, webView 加載 2.1加入白名單,
LSApplicationQueriesSchemes : alipay
if ([request.URL.absoluteString containsString:@"http://mclient.alipay.com/cashier/mobilepay.htm?alipay_exterface_invoke_assign_target"]){
//返回按鈕
UIWindow *window= [UIApplication sharedApplication].keyWindow;
_window = window;
UIImageView *topimageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 80*KPhoneHeightScale)];
_topimageView = topimageView;
topimageView.image=[UIImage imageNamed:@"背景"];
[self.view insertSubview:topimageView atIndex:1];
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth/2-50*KPhoneWidthScale, 30*KPhoneHeightScale, 100*KPhoneWidthScale, 40*KPhoneHeightScale)];
[btn2 setTitle:@"返回91好課" forState:UIControlStateNormal];
[btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
btn2.titleLabel.font = [UIFont systemFontOfSize:16];
_btn2 = btn2;
[self.view addSubview:btn2];
UIButton *failPlaybackbtn = [[UIButton alloc] initWithFrame:CGRectMake(10*KPhoneWidthScale, 35*KPhoneHeightScale, 30*KPhoneWidthScale, 30*KPhoneHeightScale)];
_failPlaybackbtn = failPlaybackbtn;
[failPlaybackbtn setImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal];
[self.view addSubview:failPlaybackbtn];
[failPlaybackbtn addTarget:self action:@selector(failPlaybackbtnAct) forControlEvents:UIControlEventTouchUpInside];
return YES;
}
AlipaySDK.bundle
AlipaySDK.framework