This is an Flutter app using flutter_inappwebview
- flutter
- you need to have a Didit Application
- didit
API Keyto create a verification session
Note: For more detailed configuration information, please check the inappwebview documentation.
On Android, you need to add these permissions in your AndroidManifest.xml file to be able to use camera for taking images and videos:
Add internet permission to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />Also, you need to add the following code inside the <application> tag of your AndroidManifest.xml file:
<provider
android:name="com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFileProvider"
android:authorities="${applicationId}.flutter_inappwebview_android.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>On iOS, you need to add the following properties in your Info.plist file to be able to use camera for taking images and videos:
<key>NSCameraUsageDescription</key>
<string>We need access to your camera to take a picture for verification</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to your microphone to record a video for verification</string>In addition to manifest/plist configurations, the app needs to request camera and microphone permissions at runtime using the permission_handler package:
await Permission.camera.request(); // Request camera permission
await Permission.microphone.request(); // Request microphone permissionThese runtime permission requests ensure that the app explicitly asks for user consent before accessing the camera and microphone.
-
Install dependencies
flutter pub get
-
Start the app
flutter run