//支付url
NSString *aliUrlStr = @"alipays://platformapi/startapp?saId=10000007&qrcode="; ?? ? ? ?
//二維碼
NSString *qrStr = @"https://qr.alipay.com/xxx"; ?? ?
? ? ?
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@" , aliUrlStr , qrStr]]; ?
//判斷是否安裝支付? ? ? ??
BOOL success = [[UIApplication sharedApplication] canOpenURL:url];? ? ?
//跳轉(zhuǎn)到支付寶
BOOL success2 = [[UIApplication sharedApplication] openURL:url];? ? ?
//跳轉(zhuǎn)到支付寶 - 可判斷跳轉(zhuǎn)成功與否
[[UIApplication sharedApplication] openURL:url options:nil completionHandler:^(BOOL success) { ? ? ? ?
????NSLog(@"completionHandler %@" , success ? @"成功" : @"失敗"); ? ?
}];? ? ? ? ??
備注:
運(yùn)行前需要在plist中添加查詢schema:LSApplicationQueriesSchemes
item0:alipays