run npm install @sency/react-native-smkit-ui
- Update Podfile in
iOS
folder:
[1] add the source to the top of your Podfile.
source 'https://bitbucket.org/sencyai/ios_sdks_release.git'
source 'https://github.com/CocoaPods/Specs.git'
[2] add use_frameworks! commend to your target
target 'YOUR_TARGET' do
use_frameworks!
[3] At the end of your code please add
post_install do |installer|
react_native_post_install(
installer,
:mac_catalyst_enabled => false
)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
- Run
NO_FLIPPER=1 pod install
to install the necessary pods. - Add camera permission request to
Info.plist
<key>NSCameraUsageDescription</key>
<string>Camera access is needed</string>
- Dynamic/Static linking issues due to
use_frameworks
: If you're unable to use use_frameworks you should add the following code to your Podfile:
# [1] Add the dynamic_frameworks array that will hold all of the dynamic frameworks names
dynamic_frameworks = ['SMKitUI', 'SMKit', 'SMBase', 'SwiftyJSON', 'SMBaseUI']
# [2] Add this pre_install function
pre_install do |installer|
installer.pod_targets.each do |pod|
if dynamic_frameworks.include?(pod.name)
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
# [3] Add this post_install function
post_install do |installer|
react_native_post_install(installer, config[:reactNativePath], :mac_catalyst_enabled => false)
installer.pods_project.targets.each do |target|
if dynamic_frameworks.include?(target.name)
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
end
end
end
Now you can run pod install.
In order to integrate SMKitUI you need your app to target minSdk 26
Add on project level build.gradle
:
buildscript {
ext {
minSdkVersion = 26
}
}
Add on project level build.gradle:
allprojects {
maven {
url "https://artifacts.sency.ai/artifactory/release/"
}
}
[1] First import configure
import { configure } from '@sency/react-native-smkit-ui/src/index.tsx';
[2] then call the configure function with your auth key
try{
var res = await configure("YOUR_AUTH_KEY");
}catch (e) {
console.error(e);
}
To reduce wait time we recommend to call configure
on app launch.
Name (enum) | Description | More info |
---|---|---|
Fitness | For individuals of any activity level who seek to enhance their physical abilities, strength, and endurance through a tailored plan. | Link |
Body360 | Designed for individuals of any age and activity level, this assessment determines the need for a preventative plan or medical support. | Link |
Strength | For individuals of any activity level who seek to assess their strength capabilities (core and endurance) * This assessment will be available soon. Contact us for more info. | Link |
Cardio | For individuals of any activity level who seek to assess their cardiovascular capabilities * This assessment will be available soon. Contact us for more info. | Link |
Custom | If Sency created a tailored assessment for you, you probably know it, and you should use this enum. |
Having issues? Contact us and let us know what the problem is.