Getting Set Up

TallyGo support for React Native is in beta. If you have any feedback or questions, don't hesitate to get in touch .

The TallyGo SDK is provided as a native Objective-C SDK for iOS, and a native Java SDK for Android. With React Native, you can use either one, or both, depending on which platforms you need to support. Keep in mind that because our SDK is a native SDK, in addition to programming in React Native with JavaScript, you also will need to be familiar with writing Objective-C and Java code if you want to use TallyGo with iOS and Android, respectively.

This guide assumes that you already have an existing React Native app. You can also take a look at our React Native Reference App .

Important note: Your app must be set up to use native code. You can determine this by whether or not you have ios and android subfolders in your project folder. If you do have these folders, you are ready. If not, you'll need to "eject" so you can use Xcode and Android Studio with your project. For more info, see the React Native docs on how to eject .

Setting up the iOS SDK

To set up the iOS SDK, follow the steps below in the ios folder of your project. (If you don't need to build for iOS, you can skip this section.)

Prerequisite: You will need to have CocoaPods and Xcode installed.

  1. Sign up for a free TallyGo account to get an SDK Access Token.
  2. Just add this pod to your CocoaPods Podfile: pod 'TallyGoKit'
  3. Then do a pod install
  4. Import the module with #import <TallyGoKit/TallyGoKit.h>
  5. Initialize the TallyGoKit with your TallyGo SDK Access Token (sent to you via email, or log in to see it here):
    [TallyGo initializeWithAccessToken:"YOUR_SDK_ACCESS_TOKEN"];
  6. Set MGLMapboxMetricsEnabledSettingShownInApp to YES in your app's Info.plist file (for telemetry).
  7. Set the NSLocationAlwaysUsageDescription and/or NSLocationWhenInUseUsageDescription keys in your app's Info.plist file (for location services).
  8. Add UIBackgroundModes with the item location in your app's Info.plist file.

Setting up the Android SDK

To set up the Android SDK, follow the steps below in the android folder of your project. (If you don't need to build for Android, you can skip this section.)

Prerequisite: You will need to have Android Studio installed.

  1. Sign up for a free TallyGo account to get an SDK Access Token
  2. Add the following to android in your build.gradle :
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
  3. Then add the following to your repositories in your build.gradle :
    repositories {
        maven {
            url "https://tallygo.bintray.com/TallyGoAndroid"
        }
    }
  4. Then add this to your dependencies in your build.gradle :
    implementation('com.tallygo:tallygo-android:2.0.+@aar') {
        transitive = true
    }
  5. Add <meta-data android:name="tallygo.ACCESS_TOKEN" android:value="@string/tallygo_access_token" /> to your <application> tag inside your AndroidManifest.xml file
  6. Initialize the TallyGo SDK with your TallyGo SDK Access Token (sent to you via email, or log in to see it here):
    Add <string name="tallygo_access_token">YOUR_SDK_ACCESS_TOKEN</string> to your strings.xml file

Next Steps

Now your React Native project is set up for the TallyGo SDK.

Next up: Get Navigation in Your App