ReactNative Installation
Technical Requirements
const Technical_Requirements = {
XCODE_VERSION: '10.0+',
STUDIO_VERSION: '3.3.2+',
IOS_VERSION: '11.0+',
ANDROID_VERSION: '5.0+',
REACT_NATIVE_VERSION: '0.63.0+',
SDK_VERSION: '3.0.1'
};
Integration via NPM or YARN
In order for your React Native project to have access to the SDK, paste the Wunderkind SDK source storage path into your project's root .npmrc
.
@wunderkind-sdk-react:registry=https://us-central1-npm.pkg.dev/wk-production-sdk/wunderkind-reactnative-sdk-production
//us-central1-npm.pkg.dev/wk-production-sdk/wunderkind-sdk-react/:_authToken=""
//us-central1-npm.pkg.dev/wk-production-sdk/wunderkind-sdk-react/:always-auth=true
Install the Wunderkind SDK with npm or yarn.
$ npm install --save @wunderkind-sdk-react/react-native-wunderkind-sdk
# or
$ yarn add @wunderkind-sdk-react/react-native-wunderkind-sdk
Linking
Autolinking
The Wunderkind SDK comes with platform-specific (native) code. In order to allow your project to discover and use this code, we recommend using AutoLinking.
iOS
Your project must use CocoaPods to install required Wunderkind dependency into your iOS project. Define the Wunderkind library in the Podfile
:
target 'Your Project Target' do
# ...
pod 'Wunderkind', podspec: 'https://storage.googleapis.com/wunderkind-ios-sdk/3.0.0.podspec'
# ...
end
Install the pods, then open your .xcworkspace
file in order to see your project in Xcode and verify the installed react-native-wunderkind-sdk:
$ npx pod-install
$ open your-project.xcworkspace
Android
Navigate to build.gradle
in application's module (by default it's in app folder) and add these lines:
android {
repositories {
maven {
url "https://us-central1-maven.pkg.dev/wk-production-sdk/wunderkind-android-sdk-production"
}
}
}
Manual Linking
In order to manually link the Wunderkind SDK's React Native 0.63.0+, please follow these additional instructions.
iOS
You can use CocoaPods to install the Wunderkind SDK into your projects. Define the Wunderkind library in the Podfile
:
target 'Your Project Target' do
# ...
pod 'react-native-wunderkind-sdk', :path => '../node_modules/@wunderkind-sdk-react/react-native-wunderkind-sdk'
pod 'Wunderkind', podspec: 'https://storage.googleapis.com/wunderkind-ios-sdk/3.0.0.podspec'
# ...
end
Install the pods, then open your .xcworkspace
file in order to see your project in Xcode and verify the installed react-native-wunderkind-sdk:
$ npx pod-install
$ open your-project.xcworkspace
Android
Define the react-native-wunderkind-sdk module in the android/settings.gradle:
include ':@wunderkind-sdk-react_react-native-wunderkind-sdk'
project(':@wunderkind-sdk-react_react-native-wunderkind-sdk').projectDir = \
new File(rootProject.projectDir, '../node_modules/@wunderkind-sdk-react/react-native-wunderkind-sdk/android')
Add the react-native-wunderkind-sdk module to the dependencies in the android/app/build.gradle
:
dependencies {
// ...
implementation project(':@wunderkind-sdk-react_react-native-wunderkind-sdk')
}
Import and link the module in the MainApplication.java
:
import co.wunderkind.sdk.WunderkindSdkPackage;
public class MainApplication extends Application implements ReactApplication {
// ...
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// ...
packages.add(new WunderkindSdkPackage());
return packages;
}
// ...
}
Updated 9 days ago