-
Notifications
You must be signed in to change notification settings - Fork 10
Upgrading to SDK v7.x
⚠️ This document relates to deprecated or obsolete SDK versions. For details regarding upgrading to the latest SDK version, consult the main Upgrade Guide.
SDK v7.5 includes Native Bridge 2.0, which provides a far simpler one-line integration between the iOS and Web SDKs, with a richer feature set and more reliable protocol. There are two implications of this:
-
You must now use Web SDK v2.1.0 or newer, which includes support for Native Bridge 2.0
-
You must update your WebView integration code to use the new Native Bridge 2.0 integration as follows:
(i) You should remove the
WKNavigationDelegate
code, as it is no longer required to intercept URL navigation events.(ii) Instead, you should simply call
webView.installIProovNativeBridge()
as early as possible in your view controller lifecycle (e.g.viewDidLoad
) which will add the Native Bridge functionality into the webview.
Please note that the legacy Native Bridge is no longer supported in SDK v7.5, so this is a mandatory upgrade.
The XCFramework distribution of iProov is now the default for Cocoapods users. There are two implications of this:
-
You must now use Cocoapods 1.9.0 or newer.
-
The workaround applied to the bottom of your Podfile should be updated to include the iProov target in the list.
The new Podfile workaround is therefore as follows:
post_install do |installer| installer.pods_project.targets.each do |target| if ['iProov', 'KeychainAccess', 'Socket.IO-Client-Swift', 'Starscream', 'SwiftyJSON'].include? target.name target.build_configurations.each do |config| config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end end end
NOTE: As of Cocoapods 1.10 release (not yet released at the time of writing), this workaround should no longer be required.
There are no code changes required to upgrade to v7.3.
Due to the addition of module stability, you must add the following workaround to the bottom of your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['KeychainAccess', 'Socket.IO-Client-Swift', 'Starscream', 'SwiftyJSON'].include? target.name
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
Failure to add this will cause your app to crash on launch. Consult the README for further details.
Due to the addition of module stability, you must now ensure that Carthage builds iProov's dependencies with the "Build Libraries for Distribution" option enabled.
This can be achieved as follows:
echo 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'>/tmp/iproov.xcconfig; XCODE_XCCONFIG_FILE=/tmp/iproov.xcconfig carthage build; rm /tmp/iproov.xcconfig
Failure to add this will cause your app to crash on launch. Consult the README for further details.
The changes required (if any) depend on your usage of the localizations features:
-
You require the SDK in English only
- No changes are required.
-
Your app provided custom Localizable.strings translations
- No changes are required.
-
You were using the
options.ui.locale
setting to force a given locale- This option is no longer available. You should override the
Base
localization in your app instead to customize/translate the strings.
- This option is no longer available. You should override the
-
You were using the nl/nn/nb/tr localizations provided with the SDK
- These translations are no longer provided bundled with the SDK. If you wish to continue offering them, you need to bundle them within your app instead. If you wish to obtain a copy of these files, please contact iProov.
-
You are redistributing the iProov SDK within your own framework, and wish to provide localized strings in your framework
- You should use the new
options.ui.stringsBundle
setting to pass your framework's bundle as the source of the strings files.
- You should use the new
options.ui.boldFont
and options.ui.regularFont
have both been combined into a single option named options.ui.font
(which is effectively the same as regularFont
, since the bold font is not used).
If you were using custom fonts provided by your app, you now need to specify it in your Info.plist instead of passing it into options.ui.fonts
.
Cocoapods users should add "Starscream" to the list of dependencies for which the module stability workaround is applied. See above (or the README) for further details.
There are no code changes required to upgrade to v7.1.
iProov v7 is a significant overhaul, and provides many new features, removes old features, and has breaking API changes.
Please consult the changelog for this release for further information about the changes in this release.
Follow the following steps to upgrade your app from v6 to v7:
-
If you are upgrading from v6.2.1 or earlier: You first need to remove the workaround for Socket.IO-Client-Swift being compiled in Swift 3.x. You should delete the following code from your
Podfile
:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'Socket.IO-Client-Swift'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
-
If you are currently using
verify(withServiceProvider...)
orenrol(withServiceProvider...)
: (...Which you should not be doing in any production apps!) You now need to call the iProov REST API yourself to obtain tokens, rather than relying on the SDK to do this for you. You can use the iOS API Client if you wish to continue with a purely on-device demo. -
Upgrade your
IProov
method calls to use the new public API. All calls should now be changed toIProov.launch(token:callback:)
. See the README for more information on this. -
If you are using any
IProovConfig
options: Update any use ofIProovConfig
to use the newOptions
struct instead. The commonly-used options are still there, however they are now better organised into sub-structs. Consult the README for more information on available options. -
If you make use of a custom
baseURL
: Instead of setting a base URL, you should now pass astreamingURL
(for Socket.IO streaming) when launching iProov, withIProov.launch(streamingURL: "https://yoururl.com", token: ...)
. -
Adapt your user interface to handle the asynchronous nature of iProov v7. You can implement your own streaming progress UI, or allow the user to continue with activities whilst the capture streams in the background. Consult the Waterloo Bank sample app to see a simple example of using MBProgressHUD to provide a similar UX to iProov v6.