Commit fd57002d authored by Javokhir's avatar Javokhir
Browse files

2.3.9

parent 545e2699
......@@ -37,9 +37,9 @@ playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
Packages/
Package.pins
Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
......@@ -54,7 +54,7 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
......@@ -87,4 +87,7 @@ fastlane/test_output
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
\ No newline at end of file
iOSInjectionProject/
# MacOS
.DS_Store
\ No newline at end of file
# CHANGELOG
## [2.3.9] - 29 Apr, 2025
- 🔨 Updated several enum values for better clarity
## [2.3.8] - 25 Apr, 2025
- 🔥 Improved overall performance and stability
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E2F858728F7186800290C6E"
BuildableName = "MyIdSample.app"
BlueprintName = "MyIdSample"
ReferencedContainer = "container:MyIdSample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E2F859D28F7186A00290C6E"
BuildableName = "MyIdSampleTests.xctest"
BlueprintName = "MyIdSampleTests"
ReferencedContainer = "container:MyIdSample.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E2F85A728F7186A00290C6E"
BuildableName = "MyIdSampleUITests.xctest"
BlueprintName = "MyIdSampleUITests"
ReferencedContainer = "container:MyIdSample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E2F858728F7186800290C6E"
BuildableName = "MyIdSample.app"
BlueprintName = "MyIdSample"
ReferencedContainer = "container:MyIdSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E2F858728F7186800290C6E"
BuildableName = "MyIdSample.app"
BlueprintName = "MyIdSample"
ReferencedContainer = "container:MyIdSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MyIdSample.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="MyIdSample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="18.840579710144929" y="97.767857142857139"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
//
// StartViewController.h
// MyIdSample
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface StartViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// StartViewController.m
// MyIdSample
#import "StartViewController.h"
@import MyIdSDK;
@interface StartViewController ()<MyIdClientDelegate>
@end
@implementation StartViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (IBAction)startMyId {
MyIdOrganizationDetails *organizationDetails = [[MyIdOrganizationDetails alloc] init];
organizationDetails.phoneNumber = @"4242";
MyIdAppearance *appearance = [[MyIdAppearance alloc] init];
appearance.primaryColor = [UIColor systemBlueColor];
MyIdConfig *config = [[MyIdConfig alloc] init];
config.clientId = @"";
config.passportData = @"";
config.dateOfBirth = @"";
config.externalId = @"";
config.buildMode = MyIdBuildModePRODUCTION;
config.entryType = MyIdEntryTypeAUTH;
config.residency = MyIdResidencyRESIDENT;
config.locale = MyIdLocaleUZ;
config.cameraShape = MyIdCameraShapeCIRCLE;
config.organizationDetails = organizationDetails;
config.appearance = appearance;
config.withPhoto = false;
[MyIdClient startWithConfig:config withDelegate:self];
}
#pragma mark MyIdClientDelegate
- (void)onSuccessWithResult:(MyIdResult *)result {
NSLog(@"%@", result.code);
NSLog(@"%@", result.comparisonValue);
NSLog(@"%@", result.image);
}
- (void)onErrorWithException:(MyIdException *)exception {
NSLog(@"%@", exception.code);
NSLog(@"%@", exception.message);
}
- (void)onUserExited {
NSLog(@"user exited");
}
@end
//
// AppDelegate.swift
// MyIdSample
//
// Created by Javokhir Savriev on 12/10/22.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}
}
//
// SceneDelegate.swift
// MyIdSample
//
// Created by Javokhir Savriev on 12/10/22.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
}
func sceneDidBecomeActive(_ scene: UIScene) {
}
func sceneWillResignActive(_ scene: UIScene) {
}
func sceneWillEnterForeground(_ scene: UIScene) {
}
func sceneDidEnterBackground(_ scene: UIScene) {
}
}
//
// ViewController.swift
// MyIdSample
//
// Created by Javokhir Savriev on 12/10/22.
//
import UIKit
import MyIdSDK
class ViewController: UIViewController {
private let clientIdTextField: UITextField = {
let textField = UITextField()
textField.placeholder = "Client ID"
textField.borderStyle = .roundedRect
textField.translatesAutoresizingMaskIntoConstraints = false
return textField
}()
private let passportTextField: UITextField = {
let textField = UITextField()
textField.placeholder = "Passport data"
textField.borderStyle = .roundedRect
textField.translatesAutoresizingMaskIntoConstraints = false
return textField
}()
private let dobTextField: UITextField = {
let textField = UITextField()
textField.placeholder = "Date of birth"
textField.borderStyle = .roundedRect
textField.translatesAutoresizingMaskIntoConstraints = false
return textField
}()
private let textResult: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 16)
label.textAlignment = .center
label.numberOfLines = 0
label.lineBreakMode = .byTruncatingTail
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private let imageResult: UIImageView = {
let imageView = UIImageView()
imageView.heightAnchor.constraint(equalToConstant: 200).isActive = true
imageView.contentMode = .scaleAspectFit
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
private var buildType: MyIdBuildMode = .PRODUCTION
private var faceImage: UIImage? = nil
override func viewDidLoad() {
super.viewDidLoad()
setupViews()
}
func loadPayload() throws -> Data {
let payloadURL = Bundle.main.url(forResource: "payload", withExtension: "json")!
let payloadData = try Data(contentsOf: payloadURL)
return payloadData
}
@objc func buildTypeControlChanged(sender: UISegmentedControl) {
if sender.selectedSegmentIndex == 1 {
buildType = .DEBUG
} else {
buildType = .PRODUCTION
}
}
@objc func scanButtonPressed(sender: UIButton) {
startMyId()
}
@objc func saveButtonPressed(sender: UIButton) {
saveImage()
}
private func startMyId() {
let config = MyIdConfig()
config.clientId = "client_id"
config.clientHash = "client_hash"
config.clientHashId = "client_hash_id"
config.passportData = self.passportTextField.text ?? ""
config.dateOfBirth = self.dobTextField.text ?? ""
config.buildMode = self.buildType
MyIdClient.start(withConfig: config, withDelegate: self)
}
private func saveImage() {
guard let image = faceImage else { return }
ImageSaver().writeToPhotoAlbum(image: image)
}
}
extension ViewController: MyIdClientDelegate {
func onSuccess(result: MyIdResult) {
textResult.text = "\(String(describing: result.code))"
imageResult.image = result.image
faceImage = result.image
}
func onError(exception: MyIdException) {
textResult.text = "\(String(describing: exception.message)) - \(String(describing: exception.code))"
}
func onUserExited() {
textResult.text = "User exited"
}
}
extension ViewController {
private func setupViews() {
let margins = view.layoutMarginsGuide
let scrollView = UIScrollView()
scrollView.translatesAutoresizingMaskIntoConstraints = false
let buildTypeControl = UISegmentedControl(items: ["PROD", "DEV"])
buildTypeControl.addTarget(self, action: #selector(buildTypeControlChanged), for: .valueChanged)
buildTypeControl.selectedSegmentIndex = 0
buildTypeControl.translatesAutoresizingMaskIntoConstraints = false
let scanButton = UIButton()
scanButton.translatesAutoresizingMaskIntoConstraints = false
scanButton.setTitle("Scan Face Data", for: .normal)
scanButton.setTitleColor(.blue, for: .normal)
scanButton.addTarget(self, action: #selector(scanButtonPressed), for: .touchUpInside)
let saveButton = UIButton()
saveButton.translatesAutoresizingMaskIntoConstraints = false
saveButton.setTitle("Save Image", for: .normal)
saveButton.setTitleColor(.red, for: .normal)
saveButton.addTarget(self, action: #selector(saveButtonPressed), for: .touchUpInside
let stackView = UIStackView()
stackView.axis = .vertical
stackView.alignment = .leading
stackView.spacing = 16
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.addArrangedSubview(clientIdTextField)
stackView.addArrangedSubview(passportTextField)
stackView.addArrangedSubview(dobTextField)
stackView.addArrangedSubview(scanButton)
stackView.addArrangedSubview(saveButton)
stackView.addArrangedSubview(textResult)
stackView.addArrangedSubview(imageResult)
scrollView.addSubview(stackView)
view.addSubview(scrollView)
NSLayoutConstraint.activate([
scrollView.leadingAnchor.constraint(equalTo: margins.leadingAnchor),
scrollView.trailingAnchor.constraint(equalTo: margins.trailingAnchor),
scrollView.topAnchor.constraint(equalTo: margins.topAnchor),
scrollView.bottomAnchor.constraint(equalTo: margins.bottomAnchor)
])
NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor),
stackView.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: 20),
stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
stackView.widthAnchor.constraint(equalTo: scrollView.widthAnchor)
])
NSLayoutConstraint.activate([
clientIdTextField.widthAnchor.constraint(equalTo: stackView.widthAnchor),
passportTextField.widthAnchor.constraint(equalTo: stackView.widthAnchor),
dobTextField.widthAnchor.constraint(equalTo: stackView.widthAnchor),
scanButton.centerXAnchor.constraint(equalTo: stackView.centerXAnchor),
saveButton.centerXAnchor.constraint(equalTo: stackView.centerXAnchor),
])
let tap = UITapGestureRecognizer(target: self, action: #selector(UIInputViewController.dismissKeyboard))
view.addGestureRecognizer(tap)
}
@objc func dismissKeyboard() {
view.endEditing(true)
}
}
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyIdSample' do
use_frameworks!
target 'MyIdSampleTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyIdSampleUITests' do
# Pods for testing
end
pod 'MyIdSDK'
end
\ No newline at end of file
PODS:
- MyIdSDK (2.2.2)
DEPENDENCIES:
- MyIdSDK
SPEC REPOS:
trunk:
- MyIdSDK
SPEC CHECKSUMS:
MyIdSDK: def78f7b73af02acda500f7a3f3e221ca9bfe20b
PODFILE CHECKSUM: 3d43422acf589a5c2bd22a9c89828a68b010d362
COCOAPODS: 1.13.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment