IOS集成说明
SDK中提供了demo(OC版本),用户使用时,只需要将demo目录下的lib文件夹添加到目标工程。包括:libTLUnifyAllinpaySDK.a、TLUnifyAllinpaySDK.h、TLUnifyAllinpaySDKBundle.bundle、ABCAppCaller.h、libABCAppCaller.a、UPPaymentControl.h、libPaymentControlMini.a。特别地,农行不支持模拟器运行,如果使用模拟器运行遇到报错,可参考该设置:Xcode -> File -> Workspace Settings -> Build System -> Legacy Build System
在目标工程的Build Settings中的Other Linker Flages选项,配置 -ObjC
需要在info.plist文件中添加App Transport Security Settings
NSAppTransportSecurity
NSAllowsArbitraryLoads
如果需要使用中行、招行等跳转至渠道 app 的渠道,需要在 Info.plist 里添加如下代码:
LSApplicationQueriesSchemes
bocpay//中行
cmbmobilebank//招行
cmbnetpay//招行
com.icbc.iphoneclient//工行
ccbmbswebunionpay//建行
ccbmobilebank//建行
paesuperbank//平安口袋银行
bankabc//农业银行
uppaywallet//云闪付APP
如果编译失败,遇到错误信息为:
XXXXXXX does not contain bitcode.
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE),
obtain an updated library from the vendor,
or disable bitcode for this target.
在目标工程的Build Settings中,设置Enable Bitcode为NO
Android集成说明
SDK中提供了demo,用户使用时,将libs目录中arr文件添加到目标工程
在对应的build.gradle引入arr文件
需要在AndroidManifest.xml,添加以下权限
需要在AndroidManifest.xml,为类PaymentActivity添加intent-filter
<activity
android:name="com.allinpay.unifypay.sdk.ui.PaymentActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<data
android:scheme="allinpaysdk"
android:host="com.allinpay.test"
android:path="/result"/>
混淆文件添加如下配置
-dontwarn com.unionpay.**
-keep class com.unionpay.** {*;}
-keep class com.allinpay.unifypay.sdk.bank.BankABCCaller