|
1 | 1 |  |
2 | 2 |  |
3 | | - |
| 3 | + |
4 | 4 |  |
5 | 5 |  |
6 | 6 |
|
7 | 7 | # Tink Link iOS |
8 | 8 |
|
9 | 9 |  |
10 | 10 |
|
11 | | - |
12 | 11 | ## Prerequisites |
13 | 12 |
|
14 | 13 | 1. [Set up your Tink Console account](https://docs.tink.com/resources/console/set-up-your-tink-account) and retrieve the `client ID` for your app. |
|
20 | 19 | * Navigate down and expand `URL Types` section. |
21 | 20 | * Press plus (`+`) button. |
22 | 21 | * Add your universal link (or deep link) scheme into `URL Schemes` field (eg. `myapp`). |
| 22 | +4. Add url handling in your app `SceneDelegate`: |
| 23 | +``` |
| 24 | +import UIKit |
| 25 | +import TinkLink |
| 26 | +class SceneDelegate: UIResponder, UIWindowSceneDelegate { |
| 27 | + |
| 28 | + func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { |
| 29 | + guard let url = URLContexts.first?.url else { return } |
| 30 | + |
| 31 | + Tink.openUrl(url) |
| 32 | + } |
| 33 | +} |
| 34 | +``` |
23 | 35 |
|
24 | 36 | ## Requirements |
25 | 37 |
|
@@ -50,6 +62,41 @@ pod "TinkLink" |
50 | 62 | 1. Download and extract the `TinkLink.xcframework` from the [releases page on GitHub](https://github.com/tink-ab/tink-link-ios/releases). |
51 | 63 | 2. Drag `TinkLink.xcframework` to the _Frameworks, Libraries, and Embedded Content_ section of the _General_ settings tab for your application target in your Xcode project. Make sure to select Copy items if needed. |
52 | 64 |
|
| 65 | +## Configuring the SDK |
| 66 | + |
| 67 | +### Configuration |
| 68 | +1. Define `clientID`: |
| 69 | +``` |
| 70 | +let clientID: String = YOUR_CLIENT_ID |
| 71 | +``` |
| 72 | +Your client ID (retrieved from [Console](https://console.tink.com)). |
| 73 | + |
| 74 | +2. Define `redirectURI`: |
| 75 | +``` |
| 76 | +let redirectURI: String = YOUR_REDIRECT_URI |
| 77 | +``` |
| 78 | +The app uri the end-user is redirected to after completing the flow together with the response parameters (configured in [Console](https://console.tink.com)). |
| 79 | + |
| 80 | +3. Define `baseDomain`: |
| 81 | +``` |
| 82 | +let baseDomain: BaseDomain = .eu |
| 83 | +``` |
| 84 | +It determines the API base domain for Tink Link. EU, US or custom. |
| 85 | + |
| 86 | +4. Define `enableSafariViewController`: |
| 87 | +``` |
| 88 | +let enableSafariViewController: Bool = false/true |
| 89 | +``` |
| 90 | +`enableSafariViewController` parameter defines SDK behaviour in case of 3rd party authentiation redirect. |
| 91 | +* Set `false` if it is preferred to redicrect to default iOS browser. |
| 92 | +In such case user being redirected into browser for authentication and back into clients app. |
| 93 | +* Set `true` if it is preferred to present 3rd party authentiation resource within clients app via [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller). |
| 94 | + |
| 95 | +5. Initialize `configuration`: |
| 96 | +``` |
| 97 | +let configuration = Configuration(clientID: clientID, redirectURI: redirectURI, baseDomain: baseDomain, enableSafariViewController: enableSafariViewController) |
| 98 | +``` |
| 99 | + |
53 | 100 | ## Launching the SDK |
54 | 101 |
|
55 | 102 | To launch the SDK in your iOS app, please see the product specific documentation. |
|
0 commit comments