Skip to content

Commit

Permalink
Prepare for beta10 release (#81)
Browse files Browse the repository at this point in the history
* Prepare for beta10 release

* Set callback URL

* callbackUrl

* Consistent back button behavior
  • Loading branch information
vanshg authored Oct 18, 2023
1 parent c64023a commit 6d4d99f
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 31 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

## 10.0.0-beta10 (unreleased)
## 10.0.0-beta10

### Added
- Enhanced Document Verification
- New JobStatusResponses that depend on the job type
- Set the callback URL by calling `SmileID.setCallbackURL(_:)`

### Changed
- Renamed `DocumentCaptureResultDelegate` -> `DocumentVerificationResultDelegate`
Expand All @@ -15,8 +15,6 @@
- Document Verification UI bugs
- Fixed a bug where Services models would have incorrect or duplicate data

### Removed

## 10.0.0-beta09

### Fixed
Expand Down
1 change: 0 additions & 1 deletion Example/SmileID/HomeView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SmileID
import SwiftUI

@available(iOS 14.0, *)
struct HomeView: View {
let partner = SmileID.configuration.partnerId
let version = SmileID.version
Expand Down
4 changes: 2 additions & 2 deletions SmileID.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = 'SmileID'
s.version = '10.0.0-beta09'
s.version = '10.0.0-beta10'
s.summary = 'The Official Smile Identity iOS SDK.'
s.homepage = 'https://docs.usesmileid.com/integration-options/mobile/ios-v10-beta'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Jubril O' => '[email protected]', 'Japhet' => '[email protected]', 'Juma Allan' => '[email protected]', 'Vansh Gandhi' => '[email protected]'}
s.source = { :git => "https://github.com/smileidentity/ios.git", :tag => "v10.0.0-beta09" }
s.source = { :git => "https://github.com/smileidentity/ios.git", :tag => "v10.0.0-beta10" }
s.ios.deployment_target = '13.0'
s.dependency 'Zip', '~> 2.1.0'
s.swift_version = '5.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ private struct IOrchestratedDocumentVerificationScreen<T, U: JobResult>: View {
// imageCaptureDelegate is just for image capture, not job result
imageCaptureDelegate: viewModel
),
showBackButton: false,
delegate: nil
)
case .processing(let state):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct EnhancedKycRequest: Codable {
dob: String? = nil,
phoneNumber: String? = nil,
bankCode: String? = nil,
callbackUrl: String?,
callbackUrl: String? = SmileID.callbackUrl,
partnerParams: PartnerParams,
sourceSdk: String = "ios",
sourceSdkVersion: String = SmileID.version,
Expand Down
3 changes: 2 additions & 1 deletion Sources/SmileID/Classes/Networking/Models/PrepUpload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Foundation

public struct PrepUploadRequest: Codable {
var partnerParams: PartnerParams
var callbackUrl: String? = ""
// Callback URL *must* be defined either within your Partner Portal or here
var callbackUrl: String? = SmileID.callbackUrl
var partnerId = SmileID.config.partnerId
var sourceSdk = "ios"
var sourceSdkVersion = SmileID.version
Expand Down
17 changes: 3 additions & 14 deletions Sources/SmileID/Classes/SelfieCapture/View/SelfieCaptureView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ public struct SelfieCaptureView: View, SelfieViewDelegate {
@EnvironmentObject var router: Router<NavigationDestination>
@ObservedObject var viewModel: SelfieCaptureViewModel
private var delegate: SmartSelfieResultDelegate?
private var originalBrightness: CGFloat
var camera: CameraView?
let arView: ARView?
let faceOverlay: FaceOverlayView
let showBackButton: Bool

init(
viewModel: SelfieCaptureViewModel,
showBackButton: Bool = true,
delegate: SmartSelfieResultDelegate?
) {
self.delegate = delegate
self.viewModel = viewModel
self.showBackButton = showBackButton
faceOverlay = FaceOverlayView(model: viewModel)
viewModel.smartSelfieResultDelegate = delegate
originalBrightness = UIScreen.main.brightness
UIScreen.main.brightness = 1
if ARFaceTrackingConfiguration.isSupported {
arView = ARView()
Expand Down Expand Up @@ -86,20 +85,10 @@ public struct SelfieCaptureView: View, SelfieViewDelegate {
Color.clear
}
}
.overlay(ZStack {
if showBackButton {
NavigationBar {
viewModel.resetState()
viewModel.pauseCameraSession()
router.pop()
}
}
})
}
.edgesIgnoringSafeArea(.all)
.navigationBarBackButtonHidden(true)
.background(SmileID.theme.backgroundMain)
.onDisappear {
UIScreen.main.brightness = originalBrightness
viewModel.cameraManager.pauseSession()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,5 @@ public struct SmartSelfieInstructionsView: View {
)
.padding(.top, 50)
}
.overlay(
NavigationBar {
viewModel.handleClose()
router.dismiss()
}
)
}
}
10 changes: 9 additions & 1 deletion Sources/SmileID/Classes/SmileID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftUI
import UIKit

public class SmileID {
public static let version = "10.0.0-beta09"
public static let version = "10.0.0-beta10"
@Injected var injectedApi: SmileIDServiceable
public static var configuration: Config { config }

Expand All @@ -22,6 +22,7 @@ public class SmileID {

public private(set) static var config: Config!
public private(set) static var useSandbox = true
public private(set) static var callbackUrl: String = ""
internal static var apiKey: String?
public private(set) static var theme: SmileIdTheme = DefaultTheme()
internal private(set) static var localizableStrings: SmileIDLocalizableStrings?
Expand Down Expand Up @@ -64,6 +65,13 @@ public class SmileID {
SmileID.useSandbox = useSandbox
}

/// Set the callback URL for all submitted jobs. If no value is set, the default callback URL
/// from the partner portal will be used.
/// - Parameter url: A valid URL pointing to your server
public class func setCallbackUrl(url: URL?) {
SmileID.callbackUrl = url?.absoluteString ?? ""
}

/// Apply theme
/// - Parameter theme: A `SmileIdTheme` used to override the colors and fonts used within the
/// SDK. If no value is set, the default theme will be used.
Expand Down

0 comments on commit 6d4d99f

Please sign in to comment.