website logo
⌘K
Introduction and Concepts
Keyri and its Uses
Smart Deep Linking
User+Device Signatures
Risk Analytics
End-to-End Encryption
Browser - Keyri Widget Quickstart
Mobile SDKs
Device Fingerprinting - UX & Fraud
iOS
Android
React Native
Flutter
Server-Side Authentication
Integrations
Amazon Cognito
Auth0
Firebase
Supabase
Ping Identity
AlphaPoint APEX System
Banno Digital Banking
Changelog
Docs powered by archbee 
18min

Flutter

System Requirements

  • Android API level 23 or higher
  • AndroidX compatibility
  • iOS 14+
  • Swift 5+
  • Apple A7 chip or newer (The A7 shipped with the iPhone 5s)

Integration

To integrate the Keyri project, run this command in terminal in root of the project directory:

Shell
|

The SDK can then be imported into any dart file as follows:

Dart
|

API

The descriptions of the individual functions of the Keyri SDKs can be found here: https://docs.keyri.com/ios https://docs.keyri.com/android https://pub.dev/documentation/keyri/latest/

Usage

Below is an example code block which utilizes the Keyri library in 2 common ways:

easyKeyriAuth()

This function allows Keyri to handle everything for you - simply pass in the User Id, App Key, and Payload and Keyri will handle displaying a built-in QR scanner, get the session information, present a Confirmation Dialogue to the user, and finalize the details with the API.

initiateQRSession()

This function can be used if you'd like to present your own custom Scanner and/or Confirmation dialogue to the user. This also works for DeepLinks/AppLinks (see below) Calling this function returns a Session object, which can be handled by:

  1. Automatically confirming (via confirmSession())
  2. Presenting your own custom confirmation screen to the user
  3. Presenting the built-in Keyri confirmation screen (initializeDefaultScreen()) - this method is used below
Dart
|

Deep linking

iOS - Universal Links

To handle Universal Links (e.g., for QR login straight from the user's built-in camera app), you need to add the Associated Domains Entitlement to your App.entitlements file. To set up the entitlement in your app, open the target’s Signing & Capabilities tab in Xcode and add the Associated Domains capability, or if you already have entitlements you can modify your App.entitlements file to match this example:

XML
|

This will handle all links with the following scheme: https://{yourCompany}.onekey.to?sessionId={sessionId}

Note: Keyri will create your https://{yourCompany}.onekey.to page automatically once you configure it in the dashboard

In the AppDelegate where the processing of links is declared, you need to add handlers in the application(_:continue:restorationHandler:) method:

AppDelegate.swift
|

Note: Keyri will set up the required /.well-known/apple-app-site-association JSON at your https://{yourSubdomain}.onekey.to page as required by Apple to handle Universal Link handling. Details on this mechanism are described here: https://developer.apple.com/documentation/Xcode/supporting-associated-domains

Android - App Links

To handle Android App Links (e.g., for QR login straight from the user's built-in camera app) you need to define the following intent-filter block in your AndroidManifest.xml:

AndroidManifest.xml
|

In the activity where the processing of links is declared, you need to add handlers in the onNewIntent() and onCreate() methods, and pass `sessionId` to `easyKeyriAuth` method:

MainActivity.kt
|



UP NEXT
Server-Side Authentication
Docs powered by archbee 
TABLE OF CONTENTS
Integration
API
Usage
easyKeyriAuth()
initiateQRSession()
Deep linking
iOS - Universal Links
Android - App Links