PRODUCT

Announcing GeoSpark ReactNative SDK

by GeoSpark Team on

The new GeoSpark ReactNative SDK makes it easier for developers to build on iOS and Android simultaneously.

Install the Module

In your project directory, install from npm, and then link it.

$ npm install native-geospark --save
$ react-native link react-native-geospark

Setup native dependencies

iOS

  1. The native iOS SDKs need to be setup using Cocoapods. In your project's ios directory, create a Podfile.
  2. Edit the Podfile to include GeoSpark as a dependency for your project, and then install the pod.
  3. Now, open the iOS project with the .xcworkspace file in Xcode, and add the GeoSpark.framework file to the linked frameworks and libraries section if they are not already added by Cocoapods.
  4. Then, go to Build Settings in the project targets and change 'Always Embed Swift Standard Libraries' to 'Yes'.
  
  $ cd ios
  $ pod init


  # ios/Podfile
  target 'AppName' do
    use_frameworks!

  # Pods for AppName
    pod 'GeoSpark'

  end
  

Android

Update compileSdkVersion, buildToolsVersion, support library version Edit the build.gradle file in your android/app directory


  android {
        compileSdkVersion 26
        buildToolsVersion "26.0.2"
        ...
    }

  groovy
  dependencies {
    ...
    compile project(':react-native-geospark')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:26.1.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
    ...
  }
  

Importing the module

Import the module in App.js file

  
  import GeoSpark from 'react-native-geospark';
  

Continue? Visit GeoSpark ReactNative SDK Docs and react-native-geospark-npm to get started.

Happy Crunching!

Announcing GeoSpark ReactNative SDK
Share this