---
title: iOS
description: Integrieren Sie die Human Token Journey in Ihre iOS-App mit ASWebAuthenticationSession — nativ, sicher und ohne WebView.
canonical: https://developer.unico.io/de/human-token/integrations/app/ios
locale: de
generated_by: markdown-export
---

- [/de/](/de/)
- [Integrationen](/de/human-token/integrations)
- App
- iOS

**Auf dieser SeiteiOSIntegrieren Sie die Human Token Journey in Ihre iOS-App mit ASWebAuthenticationSession.

`ASWebAuthenticationSession` startet die Human Token Journey in einem systemverwalteten Browser. Wenn die Journey abgeschlossen ist, kehrt die Sitzung über das registrierte URL-Schema zu Ihrer App zurück.
### Voraussetzungen​

iOS 13 oder höher
Xcode 14+
`AuthenticationServices`-Framework (integriert)
Ein eindeutiges URL-Schema für Ihre App (z. B. `myapp`)

### Schritt 1: URL-Schema definieren​

Wählen Sie ein eindeutiges Schema (z. B. `myapp`). Dies wird als `callbackUri` beim Erstellen des Prozesses verwendet:
```
callbackUri: myapp://callback
```

### Schritt 2: Presentation Context Provider erstellen​

```
import AuthenticationServicesimport UIKitclass UnicoAuthenticationController: NSObject, ASWebAuthenticationPresentationContextProviding {    func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {        guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,              let window = windowScene.windows.first else {            return ASPresentationAnchor()        }        return window    }}
```

### Schritt 3: Session-Manager erstellen​

```
import AuthenticationServicesclass AuthenticationSessionManager {    static let shared = AuthenticationSessionManager()    private var session: ASWebAuthenticationSession?    private let contextProvider = UnicoAuthenticationController()    func start(url: URL, completion: @escaping (String?) -> Void) {        let newSession = ASWebAuthenticationSession(            url: url,            callbackURLScheme: "myapp"        ) { callbackURL, error in            self.session = nil            if let callbackURL = callbackURL {                let components = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)                let processId = components?.queryItems?.first(where: { $0.name == "id" })?.value                completion(processId)            } else {                completion(nil)            }        }        newSession.presentationContextProvider = contextProvider        newSession.prefersEphemeralWebBrowserSession = true        newSession.start()        session = newSession    }}
```

### Schritt 4: Journey starten​

```
guard let url = URL(string: processLink) else { return }AuthenticationSessionManager.shared.start(url: url) { processId in    if let processId = processId {        // Journey completed — send processId to your backend via Get Process    } else {        // User canceled the session    }}
```

InformationDer Parameter `callbackURLScheme` nimmt nur den Schema-Namen (`myapp`) entgegen, ohne `://`.
### Dateiübersicht​

DateiZweck`UnicoAuthenticationController.swift`Presentation Context ProviderSession-Manager (Ihre View oder Ihr Service)`ASWebAuthenticationSession`-LebenszyklusZuletzt aktualisiert am 21. Okt. 2026**