geweald / flutter_onfido Goto Github PK
View Code? Open in Web Editor NEWFlutter Onfido Plugin
License: MIT License
Flutter Onfido Plugin
License: MIT License
Hi, I'm getting a platform exception while trying to get a result from submitting verification for captureFace only.
If I pass in both captureFace and captureDocument, it works just fine
PlatformException(error, Error serializing response, null, null)
Here is the code:
Future<void> startOnfido({required String sdkToken}) async {
try {
OnfidoResult result = await FlutterOnfido.start(
config: OnfidoConfig(
sdkToken: sdkToken, // PROVIDE TOKEN YOU'VE GOT FROM YOUR BACKEND
flowSteps: OnfidoFlowSteps(
welcome: true,
// captureDocument: OnfidoCaptureDocumentStep(
// countryCode: OnfidoCountryCode.NGA,
// docType: OnfidoDocumentType.NATIONAL_IDENTITY_CARD,
// ),
captureDocument: null,
captureFace: OnfidoCaptureFaceStep(
OnfidoCaptureType.PHOTO,
),
),
),
iosAppearance: OnfidoIOSAppearance(
onfidoPrimaryColor: "#3A3391",
),
);
print(
"=====================================================================");
print(
"=====================================================================");
print(
"=====================================================================");
print(result.face);
// ASK YOUR BACKEND IF USER HAS PASSED VERIFICATION
} on OnfidoConfigValidationException catch (e) {
print(e.message);
} on PlatformException catch (e) {
print(
"=====================================================================");
print(
"=====================================================================");
print(e);
}
}
Hi, Team
Basically we are capturing the document and photo/video for applicant_id and those details stored on Onfido dashboard on applicant_id. But this plugin is not setting the applicant id. Then where document and photo will store in Onfido dashobard?
Thanks
Manivel
Hey bud, great work on this. It was surprisingly hard to wrap this myself so super helpful.
Any idea on null safety support? Happy to PR myself if it helps.
We recently integrated the onfido plugin into our app but haven't started using it yet, still waiting for some backend work to complete so the plugin is dormant in production.
I started seeing this crash today in production without the plugin being used, I'm assuming there's some app startup stuff that runs on the native side.
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onDetachedFromActivityForConfigChanges (FlutterOnfidoPlugin.kt:87)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivityForConfigChanges (FlutterEngineConnectionRegistry.java:372)
io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:651)
io.flutter.embedding.android.FlutterFragment.onDetach (FlutterFragment.java:844)
androidx.fragment.app.Fragment.performDetach (Fragment.java:3229)
androidx.fragment.app.FragmentStateManager.detach (FragmentStateManager.java:812)
androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:353)
androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete (SpecialEffectsController.java:742)
androidx.fragment.app.SpecialEffectsController$Operation.cancel (SpecialEffectsController.java:594)
androidx.fragment.app.SpecialEffectsController.forceCompleteAllOperations (SpecialEffectsController.java:329)
androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java:3130)
androidx.fragment.app.FragmentManager.dispatchDestroy (FragmentManager.java:3105)
androidx.fragment.app.FragmentController.dispatchDestroy (FragmentController.java:334)
androidx.fragment.app.FragmentActivity.onDestroy (FragmentActivity.java:330)
android.app.Activity.performDestroy (Activity.java:8468)
android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1344)
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5652)
android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5712)
android.app.ActivityThread.handleRelaunchActivityInner (ActivityThread.java:6015)
android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:5934)
android.app.servertransaction.ActivityRelaunchItem.execute (ActivityRelaunchItem.java:69)
android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2317)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:246)
android.app.ActivityThread.main (ActivityThread.java:8625)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
This is on flutter version 2.10.1
Hello there. First of all, thanks for this project, it's gold!
I added flutter_onfido
to my project, and in summary it works for ios and fails with android. Running the example in the repo, when clicking "Enable camera", the application crashes.
D/AndroidRuntime( 9355): Shutting down VM
E/AndroidRuntime( 9355): FATAL EXCEPTION: main
E/AndroidRuntime( 9355): Process: app.broad, PID: 9355
E/AndroidRuntime( 9355): java.lang.RuntimeException: Unable to start activity ComponentInfo{app.broad/com.onfido.android.sdk.capture.ui.camera.CaptureActivity}: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
E/AndroidRuntime( 9355): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
E/AndroidRuntime( 9355): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
E/AndroidRuntime( 9355): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/AndroidRuntime( 9355): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime( 9355): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 9355): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime( 9355): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 9355): at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime( 9355): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 9355): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9355): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 9355): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime( 9355): Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
E/AndroidRuntime( 9355): at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
E/AndroidRuntime( 9355): at com.google.gson.Gson.fromJson(Gson.java:927)
E/AndroidRuntime( 9355): at com.google.gson.Gson.fromJson(Gson.java:892)
E/AndroidRuntime( 9355): at com.google.gson.Gson.fromJson(Gson.java:841)
E/AndroidRuntime( 9355): at com.google.gson.Gson.fromJson(Gson.java:813)
E/AndroidRuntime( 9355): at com.onfido.api.client.token.sdk.SDKToken.buildUrl(SDKToken.java:37)
E/AndroidRuntime( 9355): at com.onfido.api.client.OnfidoAPIFactory.create(OnfidoAPIFactory.java:34)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.utils.OnfidoApiUtil.createOnfidoApiClient(Unknown Source:18)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.SdkModule.provideOnfidoAPI(Unknown Source:9)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.SdkModule_ProvideOnfidoAPIFactory.get(Unknown Source:10)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.SdkModule_ProvideOnfidoAPIFactory.get(Unknown Source:0)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.SdkModule_ProvideOnfidoApiServiceFactory.get(Unknown Source:4)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.SdkModule_ProvideOnfidoApiServiceFactory.get(Unknown Source:0)
E/AndroidRuntime( 9355): at com.onfido.dagger.internal.a.get(Unknown Source:13)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.ui.camera.CaptureActivity_MembersInjector.injectMembers(Unknown Source:34)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.ui.camera.CaptureActivity_MembersInjector.injectMembers(Unknown Source:2)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.common.di.DaggerSdkComponent.inject(Unknown Source:2)
E/AndroidRuntime( 9355): at com.onfido.android.sdk.capture.ui.camera.CaptureActivity.onCreate(Unknown Source:20)
E/AndroidRuntime( 9355): at android.app.Activity.performCreate(Activity.java:8000)
E/AndroidRuntime( 9355): at android.app.Activity.performCreate(Activity.java:7984)
E/AndroidRuntime( 9355): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
E/AndroidRuntime( 9355): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
E/AndroidRuntime( 9355): ... 11 more
E/AndroidRuntime( 9355): Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
E/AndroidRuntime( 9355): at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
E/AndroidRuntime( 9355): at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
E/AndroidRuntime( 9355): ... 32 more
I/Process ( 9355): Sending signal. PID: 9355 SIG: 9
Lost connection to device.
Even though everything indicates it's a problem with Onfido parsing JSON, I thought you could have some advice dealing with this problem :)
[✓] Flutter (Channel beta, 1.25.0-8.1.pre, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 1.25.0-8.1.pre at /Users/juliano/bin/flutter
• Framework revision 8f89f6505b (3 weeks ago), 2020-12-15 15:07:52 -0800
• Engine revision 92ae191c17
• Dart version 2.12.0 (build 2.12.0-133.2.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/juliano/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Community Edition (version 2020.3.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Connected device (3 available)
• sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• iPhone 12 Pro Max (mobile) • 372621A5-FFA8-4221-90E2-456F2B7C300E • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.88
Thank you in advance!
(the SDK is built with 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)'). Please select a toolchain which matches the SDK.
Seems needed to upgrade to 22 iOS version
Hi guys,
My project updated to the latest version of Flutter, but got an error when build.
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then │
│ update /Users/trz/StudioProjects/my_project/android/build.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
flutter version:
Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (13 days ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2
I'm trying to run the application in the simulator launching it from the Android Visual Studio.
Running pod install...
Running Xcode build...
Xcode build done. 2.6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
warning: [CP] Unable to find matching .xcframework slice in '/Users/joaopaulosantos/Development/civic/onfido_test_app/ios/Pods/Onfido/Onfido.xcframework Onfido framework ios-i386_x86_64-simulator ios-arm64_armv7' for the current build architectures (arm64 x86_64 i386).
/Users/joaopaulosantos/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_onfido-0.2.0/ios/Classes/OnfidoSdk.swift:2:8: error: no such module 'Onfido'
import Onfido
^
/Users/joaopaulosantos/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_onfido-0.2.0/ios/Classes/OnfidoSdk.swift:2:8: error: no such module 'Onfido'
import Onfido
^
/Users/joaopaulosantos/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_onfido-0.2.0/ios/Classes/OnfidoSdk.swift:2:8: error: no such module 'Onfido'
import Onfido
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file '/Users/joaopaulosantos/Library/Developer/Xcode/DerivedData/Runner-efufydbfixpattaksvahqtdetfgr/Build/Products/Debug-iphonesimulator/Runner.app'
note: Removed stale file '/Users/joaopaulosantos/Library/Developer/Xcode/DerivedData/Runner-efufydbfixpattaksvahqtdetfgr/Build/Products/Debug-iphonesimulator/Pods_Runner.framework'
note: Removed stale file '/Users/joaopaulosantos/Library/Developer/Xcode/DerivedData/Runner-efufydbfixpattaksvahqtdetfgr/Build/Products/Debug-iphonesimulator/flutter_onfido/flutter_onfido.framework'
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro.
My Flutter doctor output:
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.56.0)
[✓] Connected device (2 available)
• No issues found!```
Hey i am using this repository for a project and i need some help, i texted you by twitter!
Hi, Team
Where do we need to add localisation files for Android and iOS?
Please add new localisation files in Android and iOS platform of example app.
Thanks
Manivel
Why json_serializable
package was deleted?
I does this question, because at onfido_config.dart line 3, it has this code:
part 'onfido_config.g.dart'; // GENERATED BY json_serializable, dependency removed, if any changes use online generator
Hello. Will there be support for the web part?
Seems the team from Onfido prepare the next release for XCode 13 and then lib should start to support the latest available version.
Is it visible to try upgrade to the latest 22 version of the library and with the next release we just bump the version?
https://github.com/onfido/onfido-ios-sdk/blob/master/MIGRATION.md#onfido-ios-sdk-2200-migration-guide
While Launching Onfido SDK its shows an exception
W/System.err( 6656): Unexpected countryCode value: [USA]
W/System.err( 6656): java.lang.Exception: Unexpected countryCode value.
W/System.err( 6656): at com.fluencybank.flutter_onfido.OnfidoSdk.getFlowStepsFromConfig(OnfidoSdk.kt:121)
W/System.err( 6656): at com.fluencybank.flutter_onfido.OnfidoSdk.start(OnfidoSdk.kt:34)
W/System.err( 6656): at com.fluencybank.flutter_onfido.FlutterOnfidoPlugin.onMethodCall(FlutterOnfidoPlugin.kt:51)
W/System.err( 6656): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err( 6656): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err( 6656): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/System.err( 6656): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err( 6656): at android.os.MessageQueue.next(MessageQueue.java:335)
W/System.err( 6656): at android.os.Looper.loop(Looper.java:183)
]
and country not launch. Last week this works fine with the same code.
Package : flutter_onfido: ^0.1.0
Code:
var result = await FlutterOnfido.start(
config: OnfidoConfig(
sdkToken: token,
flowSteps: OnfidoFlowSteps(
welcome: false,
captureDocument: OnfidoCaptureDocumentStep(
countryCode: OnfidoCountryCode.USA,
docType: selectedItem == 2
? OnfidoDocumentType.PASSPORT
: OnfidoDocumentType.GENERIC,
),
),
),
iosAppearance: OnfidoIOSAppearance(),
);
Hi,
is it possible you add the Onfido API version number in the documentation please ?
Thx by advance :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.