Installation - React Native
Installation of ZumoKit for React Native requires the installation of the library via npm or Yarn along with the linking of the native library for iOS and Android. Due to a Podfile being present in the library, React Native CLI should automatically attempt to link to iOS via CocoaPods.
Requirements
There are a number of requirements when using the ZumoKit SDK. To ensure the latest version of the C++ library is used, it is built from source and as such, there are a few more tools that will need to be installed on your system.
- Yarn / npm
- CocoaPods
- iOS 10.0+
- Xcode 11
- Android 5.0 Lollipop (API 21)
- Android Studio
- C++ 11
- JDK 8+
- pip3
- Conan
Installation
Installation via npm or Yarn through the CLI is as follows:
yarn add dlabs/zumokit-react-native
OR
npm install dlabs/zumokit-react-native
The above will install directly from the private repository on Github. Ensure you have access to
dlabs/zumokit-react-native
if you encounter any problems.
Linking
Once installed, ZumoKit can be automatically linked via the react-native
CLI.
react-native link react-native-zumo-kit
However, there is one minor change to your app's Podfile
(usually located in the ios
directory) that will need to be made. As ZumoKit is distributed privately, you'll need to include the private podspec repo. You'll also need to ensure that the minimum iOS target is 10.0 or higher.
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
source 'https://github.com/CocoaPods/Specs.git'
source 'git@github.com:dlabs/zumokit-podspecs.git'
target 'Demo' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Demo
pod 'RNZumoKit', :path => '../node_modules/react-native-zumo-kit'
end
You may also need to execute pod install
manually from the ios
directory.
Ensure you have access to
dlabs/zumokit-podspecs
anddlabs/zumokit-sdk
repositories on GitHub if you encounter any errors installing via CocoaPods.