Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 4.9.0

Adds the opt-in `showLanguageSelector` configuration option.

When enabled, users can change the verification language from the welcome screen using the same compact, searchable selector as the web verification flow.
The selector remains hidden by default.

Pins the iOS and Android native SDKs exactly to 4.9.0.


## 4.8.0

- Native SDKs 4.8.0 on both platforms.
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ didit_sdk_ios_pod = case $DiditSdkIosVariant
else
raise "Invalid $DiditSdkIosVariant '#{$DiditSdkIosVariant}'. Supported values: all, core, autodetection, nfc."
end
didit_sdk_ios_podspec = 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.8.0/DiditSDK.podspec'
didit_sdk_ios_podspec = 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.9.0/DiditSDK.podspec'

target 'Runner' do
use_frameworks!
Expand Down Expand Up @@ -286,6 +286,7 @@ final result = await DiditSdk.startVerification(
'your-session-token',
config: DiditConfig(
languageCode: 'he', // Force Hebrew language
showLanguageSelector: true, // Let the user change language
fontFamily: 'Avenir', // Custom font
loggingEnabled: true, // Debug logging
),
Expand All @@ -297,6 +298,7 @@ final result = await DiditSdk.startVerification(
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `languageCode` | `String?` | Device locale | ISO 639-1 language code (e.g. `"en"`, `"fr"`, `"ar"`) |
| `showLanguageSelector` | `bool` | `false` | Show the web-style language selector on the welcome screen |
| `fontFamily` | `String?` | System font | Custom font family name |
| `loggingEnabled` | `bool` | `false` | Enable SDK debug logging |
| `showCloseButton` | `bool` | `true` | Show the close (X) button on verification step screens |
Expand All @@ -321,6 +323,17 @@ await DiditSdk.startVerification(token, config: DiditConfig(languageCode: 'he'))
await DiditSdk.startVerification(token);
```

### `showLanguageSelector`

Set this to `true` to let users change the verification language from the welcome screen. The selector is hidden by default.

```dart
await DiditSdk.startVerification(
token,
config: const DiditConfig(showLanguageSelector: true),
);
```

### `fontFamily`

Overrides the font used throughout the SDK UI. The font must be registered in your app's native configuration:
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = "me.didit.sdk.sdk_flutter"
version = "1.0-SNAPSHOT"

val diditSdkAndroidVersion = "4.8.0"
val diditSdkAndroidVersion = "4.9.0"
val diditSdkAndroidVariant = (
rootProject.findProperty("diditSdkAndroidVariant")
?: findProperty("diditSdkAndroidVariant")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class SdkFlutterPlugin :

return Configuration(
languageLocale = language,
showLanguageSelector = map["showLanguageSelector"] as? Boolean ?: false,
fontFamily = map["fontFamily"] as? String,
loggingEnabled = map["loggingEnabled"] as? Boolean ?: false,
showCloseButton = map["showCloseButton"] as? Boolean ?: true,
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ didit_sdk_ios_pod = case $DiditSdkIosVariant
end
didit_sdk_ios_podspec = ENV.fetch(
'DIDIT_SDK_IOS_PODSPEC',
'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.8.0/DiditSDK.podspec'
'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.9.0/DiditSDK.podspec'
)

target 'Runner' do
Expand Down
16 changes: 8 additions & 8 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
PODS:
- didit_sdk (4.8.0):
- DiditSDK/All (= 4.8.0)
- didit_sdk (4.9.0):
- DiditSDK/All (= 4.9.0)
- Flutter
- DiditSDK/All (4.8.0)
- DiditSDK/All (4.9.0)
- Flutter (1.0.0)
- integration_test (0.0.1):
- Flutter

DEPENDENCIES:
- didit_sdk (from `.symlinks/plugins/didit_sdk/ios`)
- DiditSDK/All (from `https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.8.0/DiditSDK.podspec`)
- DiditSDK/All (from `https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.9.0/DiditSDK.podspec`)
- Flutter (from `Flutter`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)

EXTERNAL SOURCES:
didit_sdk:
:path: ".symlinks/plugins/didit_sdk/ios"
DiditSDK:
:podspec: https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.8.0/DiditSDK.podspec
:podspec: https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.9.0/DiditSDK.podspec
Flutter:
:path: Flutter
integration_test:
:path: ".symlinks/plugins/integration_test/ios"

SPEC CHECKSUMS:
didit_sdk: 5b9f62df3c640e3f8a8a12b607594e4694a98ead
DiditSDK: 1f7080792951b143ab66ac7327c7fe868a68d0ec
didit_sdk: 0f0ca48a71ae905c2de71b02d24475e05db52cf9
DiditSDK: 18cfba785d456e42e3f6cc70f4c69da112fad0f7
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e

PODFILE CHECKSUM: 0b5e0608cb5879362a01eb8afc4c36bfbe81c08e
PODFILE CHECKSUM: dcce6b2a7fd6d6fac6c43415d61be3170315620f

COCOAPODS: 1.16.2
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.8.0"
version: "4.9.0"
fake_async:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions ios/didit_sdk.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'didit_sdk'
s.version = '4.8.0'
s.version = '4.9.0'
s.summary = 'Didit Identity Verification SDK for Flutter'
s.description = <<-DESC
Flutter plugin wrapping the native DiditSDK for identity verification
Expand Down Expand Up @@ -31,7 +31,7 @@ with document scanning, NFC passport reading, and liveness detection.
else
raise "Invalid DiditSdk iOS variant '#{didit_sdk_ios_variant}'. Set $DiditSdkIosVariant in your Podfile to one of: all, core, autodetection, nfc."
end
s.dependency didit_sdk_ios_pod, '4.8.0'
s.dependency didit_sdk_ios_pod, '4.9.0'

s.platform = :ios, '13.0'
s.static_framework = true
Expand Down
2 changes: 1 addition & 1 deletion ios/didit_sdk/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
.library(name: "didit-sdk", targets: ["didit_sdk"])
],
dependencies: [
.package(url: "https://github.com/didit-protocol/sdk-ios.git", exact: "4.8.0")
.package(url: "https://github.com/didit-protocol/sdk-ios.git", exact: "4.9.0")
],
targets: [
.target(
Expand Down
3 changes: 2 additions & 1 deletion ios/didit_sdk/Sources/didit_sdk/SdkFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public class SdkFlutterPlugin: NSObject, FlutterPlugin {
defaultDocumentCamera: defaultDocumentCamera,
defaultLivenessCamera: defaultLivenessCamera,
showDocumentCameraSwitchButton: dict["showDocumentCameraSwitchButton"] as? Bool ?? true,
showLivenessCameraSwitchButton: dict["showLivenessCameraSwitchButton"] as? Bool ?? true
showLivenessCameraSwitchButton: dict["showLivenessCameraSwitchButton"] as? Bool ?? true,
showLanguageSelector: dict["showLanguageSelector"] as? Bool ?? false
)
}

Expand Down
17 changes: 7 additions & 10 deletions lib/sdk_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class DiditSdk {
static int _transactionCallCounter = 0;
static bool _transactionUpdateHandlerRegistered = false;
static final Map<String, void Function(DiditTransactionResult)>
_pendingTransactionUpdates = {};
_pendingTransactionUpdates = {};

static void _ensureTransactionUpdateHandler() {
if (_transactionUpdateHandlerRegistered) return;
Expand Down Expand Up @@ -140,15 +140,12 @@ class DiditSdk {
_pendingTransactionUpdates[callId] = onTransactionUpdated;
}
try {
final raw = await SdkFlutterPlatform.instance.submitTransaction(
transactionToken,
transaction.toMap(),
{
'callId': callId,
'autoLaunchAction': options.autoLaunchAction,
if (options.baseUrl != null) 'baseUrl': options.baseUrl,
},
);
final raw = await SdkFlutterPlatform.instance
.submitTransaction(transactionToken, transaction.toMap(), {
'callId': callId,
'autoLaunchAction': options.autoLaunchAction,
if (options.baseUrl != null) 'baseUrl': options.baseUrl,
});
final result = DiditTransactionResult.fromMap(raw);
if (result.actionRequired == null) {
_pendingTransactionUpdates.remove(callId);
Expand Down
7 changes: 4 additions & 3 deletions lib/sdk_flutter_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MethodChannelSdkFlutter extends SdkFlutterPlatform {
final methodChannel = const MethodChannel('didit_sdk');

void Function(String callId, Map<String, dynamic> result)?
_transactionUpdateHandler;
_transactionUpdateHandler;

@override
Future<Map<String, dynamic>> startVerification(
Expand Down Expand Up @@ -69,8 +69,9 @@ class MethodChannelSdkFlutter extends SdkFlutterPlatform {
void Function(String callId, Map<String, dynamic> result)? handler,
) {
_transactionUpdateHandler = handler;
methodChannel
.setMethodCallHandler(handler == null ? null : _handlePlatformCall);
methodChannel.setMethodCallHandler(
handler == null ? null : _handlePlatformCall,
);
}

Future<dynamic> _handlePlatformCall(MethodCall call) async {
Expand Down
6 changes: 4 additions & 2 deletions lib/sdk_flutter_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ abstract class SdkFlutterPlatform extends PlatformInterface {
Map<String, dynamic>? config,
) {
throw UnimplementedError(
'startVerificationWithWorkflow() has not been implemented.');
'startVerificationWithWorkflow() has not been implemented.',
);
}

/// Submit a transaction with a transaction SDK token.
Expand All @@ -58,6 +59,7 @@ abstract class SdkFlutterPlatform extends PlatformInterface {
void Function(String callId, Map<String, dynamic> result)? handler,
) {
throw UnimplementedError(
'setTransactionUpdateHandler() has not been implemented.');
'setTransactionUpdateHandler() has not been implemented.',
);
}
}
95 changes: 47 additions & 48 deletions lib/src/transactions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,18 @@ class DiditTransactionInfo {
});

Map<String, dynamic> toMap() => {
if (direction != null) 'direction': direction,
if (amount != null) 'amount': amount,
if (currency != null) 'currency': currency,
if (currencyType != null) 'currencyType': currencyType,
if (amountInDefaultCurrency != null)
'amountInDefaultCurrency': amountInDefaultCurrency,
if (defaultCurrencyCode != null)
'defaultCurrencyCode': defaultCurrencyCode,
if (paymentDetails != null) 'paymentDetails': paymentDetails,
if (paymentTxnId != null) 'paymentTxnId': paymentTxnId,
if (type != null) 'type': type,
if (cryptoParams != null) 'cryptoParams': cryptoParams,
};
if (direction != null) 'direction': direction,
if (amount != null) 'amount': amount,
if (currency != null) 'currency': currency,
if (currencyType != null) 'currencyType': currencyType,
if (amountInDefaultCurrency != null)
'amountInDefaultCurrency': amountInDefaultCurrency,
if (defaultCurrencyCode != null) 'defaultCurrencyCode': defaultCurrencyCode,
if (paymentDetails != null) 'paymentDetails': paymentDetails,
if (paymentTxnId != null) 'paymentTxnId': paymentTxnId,
if (type != null) 'type': type,
if (cryptoParams != null) 'cryptoParams': cryptoParams,
};
}

/// Payment method of a transaction participant.
Expand All @@ -66,10 +65,10 @@ class DiditTransactionPaymentMethod {
});

Map<String, dynamic> toMap() => {
if (type != null) 'type': type,
if (accountId != null) 'accountId': accountId,
if (issuingCountry != null) 'issuingCountry': issuingCountry,
};
if (type != null) 'type': type,
if (accountId != null) 'accountId': accountId,
if (issuingCountry != null) 'issuingCountry': issuingCountry,
};
}

/// A transaction participant (subject or counterparty).
Expand Down Expand Up @@ -102,17 +101,17 @@ class DiditTransactionParticipant {
});

Map<String, dynamic> toMap() => {
if (type != null) 'type': type,
if (externalUserId != null) 'externalUserId': externalUserId,
if (fullName != null) 'fullName': fullName,
if (firstName != null) 'firstName': firstName,
if (lastName != null) 'lastName': lastName,
if (dob != null) 'dob': dob,
if (address != null) 'address': address,
if (institutionInfo != null) 'institutionInfo': institutionInfo,
if (device != null) 'device': device,
if (paymentMethod != null) 'paymentMethod': paymentMethod!.toMap(),
};
if (type != null) 'type': type,
if (externalUserId != null) 'externalUserId': externalUserId,
if (fullName != null) 'fullName': fullName,
if (firstName != null) 'firstName': firstName,
if (lastName != null) 'lastName': lastName,
if (dob != null) 'dob': dob,
if (address != null) 'address': address,
if (institutionInfo != null) 'institutionInfo': institutionInfo,
if (device != null) 'device': device,
if (paymentMethod != null) 'paymentMethod': paymentMethod!.toMap(),
};
}

/// Travel rule information attached to a transaction.
Expand All @@ -136,14 +135,14 @@ class DiditTravelRule {
});

Map<String, dynamic> toMap() => {
if (status != null) 'status': status,
if (protocol != null) 'protocol': protocol,
if (required != null) 'required': required,
if (obligationsCount != null) 'obligationsCount': obligationsCount,
if (originatorData != null) 'originatorData': originatorData,
if (beneficiaryData != null) 'beneficiaryData': beneficiaryData,
if (metadata != null) 'metadata': metadata,
};
if (status != null) 'status': status,
if (protocol != null) 'protocol': protocol,
if (required != null) 'required': required,
if (obligationsCount != null) 'obligationsCount': obligationsCount,
if (originatorData != null) 'originatorData': originatorData,
if (beneficiaryData != null) 'beneficiaryData': beneficiaryData,
if (metadata != null) 'metadata': metadata,
};
}

/// A transaction to submit from the device.
Expand Down Expand Up @@ -184,18 +183,18 @@ class DiditTransactionPayload {
});

Map<String, dynamic> toMap() => {
'txnId': txnId,
if (txnDate != null) 'txnDate': txnDate,
if (zoneId != null) 'zoneId': zoneId,
if (type != null) 'type': type,
if (info != null) 'info': info!.toMap(),
if (subject != null) 'subject': subject!.toMap(),
if (counterparty != null) 'counterparty': counterparty!.toMap(),
if (props != null) 'props': props,
if (travelRule != null) 'travelRule': travelRule!.toMap(),
if (includeCryptoScreening != null)
'includeCryptoScreening': includeCryptoScreening,
};
'txnId': txnId,
if (txnDate != null) 'txnDate': txnDate,
if (zoneId != null) 'zoneId': zoneId,
if (type != null) 'type': type,
if (info != null) 'info': info!.toMap(),
if (subject != null) 'subject': subject!.toMap(),
if (counterparty != null) 'counterparty': counterparty!.toMap(),
if (props != null) 'props': props,
if (travelRule != null) 'travelRule': travelRule!.toMap(),
if (includeCryptoScreening != null)
'includeCryptoScreening': includeCryptoScreening,
};
}

/// A user action required to complete the transaction.
Expand Down
Loading
Loading