diff --git a/android/build.gradle b/android/build.gradle index 38e8f7d..a317172 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -77,5 +77,5 @@ dependencies { implementation "androidx.browser:browser:1.2.0" - implementation("com.authsignal:authsignal-android:3.1.1") + implementation("com.authsignal:authsignal-android:3.2.0") } diff --git a/package.json b/package.json index 4e9e282..f2f574a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-authsignal", - "version": "2.1.0", + "version": "2.2.0", "description": "The official Authsignal React Native library.", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/src/qr.ts b/src/qr.ts index b1ea6f4..e56ee10 100644 --- a/src/qr.ts +++ b/src/qr.ts @@ -2,6 +2,7 @@ import { NativeModules, Platform } from 'react-native'; import { handleErrorCodes, LINKING_ERROR } from './error'; import type { AddCredentialInput, + AppChallenge, AppCredential, AuthsignalResponse, ClaimChallengeInput, @@ -84,6 +85,22 @@ export class AuthsignalQrCode { } } + async getChallenge(): Promise> { + await this.ensureModuleIsInitialized(); + + try { + const data = await AuthsignalQRCodeModule.getChallenge(); + + return { data }; + } catch (ex) { + if (this.enableLogging) { + console.log(ex); + } + + return handleErrorCodes(ex); + } + } + async removeCredential(): Promise> { await this.ensureModuleIsInitialized();