iOS Integration Options
π± Installation guide for our iOS
UIKit
import UIKit
import SafariServices
let url = URL(string: "https://www.blockchain.com/pay/widget?apiKey=[your-api-key]")!
present(SFSafariViewController(url: url), animated: true, completion: nil)SwiftUI
import SwiftUI
import SafariServices
struct SafariView: UIViewControllerRepresentable {
let url: URL
func makeUIViewController(context: Context) -> SFSafariViewController {
SFSafariViewController(url: url)
}
func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {}
}
struct ContentView: View {
@State private var showBlockchainPay = false
let url = URL(string: "https://www.blockchain.com/pay/widget")!
var body: some View {
Button("Blockchain Pay") {
showBlockchainPay = true
}
.sheet(isPresented: $showBlockchainPay) {
SafariView(url: url)
}
}
}React Native
Last updated