# iOS Integration Options

Below are the three common ways to integrate web widgets into your iOS app.

* [Using UIKit](#uikit)
* [Using SwiftUI](#swiftui)
* [Using React Native](#react-native)

## UIKit

UIKit supports SFSafariViewController, which is a great way to display web content in your app. SFSafariViewController shares cookies, supports saved autofill data, and natively supports Apple Pay, unlike the generic web view.&#x20;

See Apple's [integration guide for SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) for more details.

```swift
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

No native support for SFSafariViewController

```swift
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

```bash
npm install react-native-safari-view
```

```jsx
import React from 'react';
import { Button } from 'react-native';
import SafariView from 'react-native-safari-view';

function App() {
  const showBlockchainPay = () => {
    const url = "";

    SafariView.isAvailable()
      .then(SafariView.show({ url: url }))
      .catch(error => {
        console.log('SafariView is not available', error);
      });
  };

  return <Button title="Blockchain Pay" onPress={showBlockchainPay} />;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockchain.com/pay/getting-started/integration-options/mobile-integration/ios-integration-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
