Skip to content
Closed
Show file tree
Hide file tree
Changes from 16 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
61 changes: 48 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Lint Build and Test

on:
pull_request:
push:
Expand All @@ -10,68 +11,102 @@

jobs:
Flutter:
name: Flutter Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.0' # Set the desired Flutter version here
flutter-version: '3.32.0'
channel: 'stable'

- name: Install Dependencies
run: flutter pub get && cd sample && flutter pub get && cd ..

- name: Lint Flutter
run: dart format . --set-exit-if-changed && flutter analyze

Android:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: Android Lint, Test, and Build
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GRADLE_OPTS: "-Dorg.gradle.vfs.watch=false"
timeout-minutes: 10
strategy:
matrix:
flutter-version: ['3.32.0']

steps:
- uses: actions/checkout@v5

- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'

- name: Cache Flutter Pub
uses: actions/cache@v4
with:
path: |
~/.pub-cache
build
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Install Dependencies
run: flutter pub get && cd sample && flutter pub get && cd ..

- name: Lint Android
uses: musichin/ktlint-check@v3
with:
ktlint-version: "1.7.0"
patterns: |
**/**.kt
!**/**.g.kt
!**/generated/**
- name: Test

- name: Test Flutter Code
run: flutter test && cd sample && flutter test && cd ..

- name: Build Android Sample App
run: cd sample && flutter build apk && cd ..

iOS:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
# TODO: Change back to macos-latest once it points to macOS 14 (Q2 '24)
name: iOS Build
runs-on: macos-14
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- run: touch sample/ios/smile_config.json

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.0' # Set the desired Flutter version here
flutter-version: '3.32.0'
channel: 'stable'
- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.14.3
- name: Install Dependencies
run: flutter pub get && cd sample && flutter pub get && cd ..
- name: Build iOS Sample App
run: cd sample/ios && pod install && flutter build ios --no-codesign && cd ..

- name: Enable SPM and Build iOS
run: |
flutter config --enable-swift-package-manager
flutter pub get
cd sample
flutter pub get
flutter build ios --no-codesign
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ build/
.fvm/
smile_config.json

sample/android/app/.cxx
sample/android/app/.cxx

.build/
.swiftpm/
Empty file removed ios/Assets/.gitkeep
Empty file.
28 changes: 0 additions & 28 deletions ios/smile_id.podspec

This file was deleted.

59 changes: 59 additions & 0 deletions ios/smile_id/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions ios/smile_id/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// swift-tools-version: 5.9

import PackageDescription

let package = Package(
name: "smile_id",
platforms: [
.iOS("13.0")
],
products: [
.library(name: "smile-id", targets: ["smile_id"])
],
dependencies: [
.package(url: "https://github.com/smileidentity/ios.git", .upToNextMajor(from: "11.1.2")),
.package(url: "https://github.com/weichsel/ZIPFoundation.git", exact: "0.9.20"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.5.2"),
.package(url: "https://github.com/fingerprintjs/fingerprintjs-ios", exact: "1.6.0"),
.package(url: "https://github.com/smileidentity/smile-id-security", exact: "11.1.2"),
.package(url: "https://github.com/getsentry/sentry-cocoa", exact: "8.57.0")

],
targets: [
.target(
name: "smile_id",
dependencies: [
"SmileIDSDK",
.product(name: "ZIPFoundation", package: "ZIPFoundation"),
.product(name: "Lottie", package: "lottie-spm"),
.product(name: "FingerprintJS", package: "fingerprintjs-ios"),
.product(name: "Sentry", package: "sentry-cocoa"),
.product(name: "SmileIDSecurity", package: "smile-id-security")
],
),
.binaryTarget(
name: "SmileIDSDK",
url: "https://github.com/smileidentity/ios/releases/download/v11.1.2/SmileIDSDK.xcframework.zip",
checksum: "623d441897a824e7bf7ed41ac55565d27bc266d4f5872ff94f40043dd7654b42"
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SmileID
import SmileIDSDK
import Foundation

func convertNullableMapToNonNull(data: [String?: String?]?) -> [String: String]? {
guard let unwrappedData = data else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDBiometricKYC : NSObject, FlutterPlatformView, BiometricKycResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

extension Dictionary where Key == String, Value == Any {
func toJSONCompatibleDictionary() -> [String: Any] {
var jsonCompatibleDict = [String: Any]()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Combine
import Flutter
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDDocumentCaptureView: NSObject, FlutterPlatformView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDDocumentVerification : NSObject, FlutterPlatformView, DocumentVerificationResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDEnhancedDocumentVerification : NSObject, FlutterPlatformView, EnhancedDocumentVerificationResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Flutter
import SmileID
import SmileIDSDK
import UIKit

public class SmileIDPlugin: NSObject, FlutterPlugin, SmileIDApi {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDSmartSelfieAuthentication : NSObject, FlutterPlatformView, SmartSelfieResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDSmartSelfieAuthenticationEnhanced : NSObject, FlutterPlatformView, SmartSelfieResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Combine
import Flutter
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDSmartSelfieCaptureView: NSObject, FlutterPlatformView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDSmartSelfieEnrollment : NSObject, FlutterPlatformView, SmartSelfieResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Flutter
import UIKit
import SmileID
import SmileIDSDK
import SwiftUI

class SmileIDSmartSelfieEnrollmentEnhanced: NSObject, FlutterPlatformView, SmartSelfieResultDelegate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import SmileID
import SmileIDSDK
import UIKit

extension String {
func isValidUrl() -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion pigeon/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:pigeon/pigeon.dart';
kotlinOut:
'android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt',
kotlinOptions: KotlinOptions(errorClassName: "SmileFlutterError"),
swiftOut: 'ios/Classes/SmileIDMessages.g.swift',
swiftOut: 'ios/smile_id/Sources/smile_id/SmileIDMessages.g.swift',
swiftOptions: SwiftOptions(),
dartPackageName: 'smileid',
))
Expand Down
2 changes: 2 additions & 0 deletions sample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
2 changes: 1 addition & 1 deletion sample/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>13.0</string>
</dict>
</plist>
Loading
Loading