Getting Started

Requirements


iOS

  • Xcode 11 and iOS SDK 13
  • iOS 9.0+ target deployment
  • Valid architectures: armv7, armv7s, arm64 devices and i386, x86_64 simulators

Android

Minimum Android SDK version - 21.

Installing react native module


  1. Install the module with npm:
    npm install react-native-synerise-sdk --save
    
  2. If you are using React Native >= 0.60, install the native dependencies by using CocoaPods from your ios directory:
    pod install
    
  3. In your android build.gradle top-level build file, add:
    maven {
       url "https://synerise.bintray.com/Android"
    }
    
  4. If you are using React Native < 0.60, perform the following actions:
    1. Link the native dependency:
      react-native link react-native-synerise-sdk
      
    2. Install from your ios directory:
      pod install --repo-update
      

Setting up iOS


Note: Starting from React Native 0.60, CocoaPods is now the default integration approach for React Native iOS projects.
  1. In your ios/Podfile, add the following dependency: pod 'react-native-synerise-sdk', :path => '../node_modules/react-native-synerise-sdk'
  2. Your Podfile should now look like below:
    target 'YourTarget' do
           
    # Pods for your target
    pod 'React', :path => '../node_modules/react-native/'
    pod 'React-Core', :path => '../node_modules/react-native/React'
    # ... other React dependencies
             
    # Add react-native-synerise-sdk
    pod 'react-native-synerise-sdk', :path => '../node_modules/react-native-synerise-sdk'
           
    use_native_modules!
    
    end
    
  3. From your ios directory, run pod install
Note: If you prefer linking manually, check React Native - Linking Libraries to link your libraries that contain native code.

Setting up Android


  1. In your app’s build.gradle file, add the following dependency: implementation 'com.synerise.sdk.react:react-native-synerise-sdk:0.9.0'
  2. In the app’s main class, add RNSyneriseSdkPackage to your list of packages:
@Override
protected List<ReactPackage> getPackages() {
	@SuppressWarnings("UnnecessaryLocalVariable")
	List<ReactPackage> packages = new PackageList(this).getPackages();
	packages.add(new RNSyneriseSdkPackage(getApplication()));

	return packages;
}

Initializing Synerise SDK


import { Synerise } from 'react-native-synerise-sdk';

Synerise.Initializer()
  .withBaseUrl("YOUR_API_BASE_URL") // If you use custom API environment
  .withClientApiKey('YOUR_CLIENT_API_KEY')
  .withDebugModeEnabled(true)
  .withCrashHandlingEnabled(true)
  .withSettings({
    sdk: {
      enabled: true
  }) // If you want to prepare some settings before initialization
  .init();

Synerise.onReady(function() {
  // This function is called when Synerise is fully initialized and ready
});

Synerise.onError(function(error) {
  // This function is called when an error occurs while Synerise initialization
});
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.