Installation Guide
OkayCam
Android Installation Guide
Note: Please make sure the SDK version tally with the provided license key.
OkayCam SDK is available through maven central repo. To install it, add following dependency in app/build.gradle dependencies block:
dependencies {
implementation('com.innov8tif.okaycam:OkayCam:3.0.0') {
transitive = true
}
} Also add following repo in project root build.gradle:
allprojects {
repositories {
maven {
url "https://innov8tif-okaycam.firebaseapp.com"
content {
includeGroup "com.innov8tif.xendity"
}
}
}
}License Key
The license key is a string which you need to request from Innov8tif. In the following usage example, we put as LICENSE_KEY but you can use whatever variable name you want.
Starting Camera
Camera can be launched by invoking start method on OkayCamDoc with context,config and callback method as follow
config object is optional if you call from Kotlin (refer to Configuration for more info)
after the image is captured or the user cancel, the callback method will be called (refer result)
OkayCamDoc.start(this,LICENSE_KEY, config) { success, images, exception ->
// do something with the result
}iOS Installation Guide
In iOS, OkayCam is available through the CocoaPods. The first step of the installation for OkayCam in iOS is to simply add the following line of code to your Podfiles as shown below:
Note: Please make sure the SDK version tally with the provided license key.
use_frameworks!
pod 'OkayCam'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "CryptoSwift"
puts "Enable module stability for CryptoSwift"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
endAfter adding the code above to the Podfiles:
Run the command
pod installto install the dependencyAdd
NSCameraUsageDescriptionto theinfo.plistin order to gain camera permissions
React-Native Installation Guide
In React-native, the first step of the installation is to install the react-native OkayCam into the environment using the command below:
Note: Please make sure the SDK version tally with the provided license key.
Version 3:
$ yarn add [email protected] - For version 3 Version 1:
react-native install [email protected]For Android in React-Native:
Navigate to
androidfolderAdd following snippet in the root
build.gradlefile:
allprojects {
repositories {
maven {
url "https://innov8tif-okaycam.firebaseapp.com"
content {
includeGroup "com.innov8tif.xendity"
}
}
}
}Sync Gradle
For iOS in React-native:
Navigate to iOS folder
Add the following code to Podfile
platform :ios, '15.0'
use_frameworks!
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "CryptoSwift"
puts "Enable module stability for CryptoSwift"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
if (target.name&.eql?('FBReactNativeSpec'))
target.build_phases.each do |build_phase|
if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
target.build_phases.move(build_phase, 0)
end
end
end
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
end
end
endAfter adding the code above to the Podfiles:
Run the command
pod installto install the dependencyAdd "NSCameraUsageDescription" to the info.plist in order to gain camera permissions
Issues
Android:
There will be a duplicate class "org.hamcrest.xxx"
If the above error is encountered, it can be solved by excluding the "junit" module below:
configurations { compile.exclude group: "junit", module: "junit" }iOS:
There will be several issues stated in the quote below:
Undefined symbol: _swift_FORCE_LOAD$_swiftUniformTypeIdentifiers
Undefined symbol: _swift_FORCE_LOAD$_swiftCoreMIDI
If users encountered the errors above, it can be solved by creating a new swift file called Void.swift without adding a bridging header.

License
After that, a license key is required for both Android and iOS by adding the code below:
const license = Platform.select({
android: "",
ios: ""
})Please refer to
OkayCam SDK V1
OkayCam SDK V2
Last updated
Was this helpful?
