To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 13.0+
- Swift 5.0+
To install it, simply add the following line to your Podfile:
s.dependency 'SBPPayment'
import UIKit
import SBPPayment
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
SBPWidgetModule().show(on: self) { result in
switch result {
case .success(let scheme):
print(scheme ?? "widget has been closed")
case .failure(let error):
print(error)
}
}
}
}
also you need add LSApplicationQueriesSchemes key into you project info.plst
<key>LSApplicationQueriesSchemes</key>
<array>
<string>bank100000000000</string>
<string>bank100000000001</string>
...
<string>bank100000000999</string>
<string>bank100000001000</string>
</array>
Warning! Starting with iOS 15 there's limit in maximum 50 entries in list, so you probably need to take first 50 entries from c2bmembers.json. Look for details here.
That's need for UIApplication.shared.canOpenURL
method worked correctly.
You can copy and paste all lines from example
SBPWidget is available under the MIT license. See the LICENSE file for more info.