segment-boneyard / SegmentMobileDemoReactNative

This application demonstrates how to integrate the Segment react-native library with a mobile application running on Android and iOS. This application also uses the Shopify GraphQL APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SegmentMobileDemoReactNative

js-standard-style

  • React Native App Utilizing Ignite

⬆️ How to Setup

Step 1: git clone this repo

Step 2: cd to the cloned repo

Step 3: yarn install

Step 4: cd ./ios && pod install (make sure you have Cocoapods set up)

If you are updating from an old version of this app - you may want to delete all of your Pods and reinstall them and rebuild the app (iOS only).

Make sure that you are using the Cocapods-generated .workspace file when working with xcode otherwise you will have problems.

In order for this app to be built and deployed to a simulator, you will need to enable a developer profile in xcode, even when using the command line build tools.

▶️ How to Run App

  1. cd to the repo
  2. Run Build for either OS
  • for iOS
    • run react-native run-ios
  • for Android
    • Run Genymotion
    • run react-native run-android

🔐 Secrets

This project uses react-native-config to expose config variables to your javascript code in React Native.

You have to provide a .env file with at least the following entries:

SEGMENT_WRITE_KEY= <your Segment write key>
SHOPIFY_API_URL= <your shopify API endpoint>
SHOPIFY_AUTH_TOKEN= <your shopify auth token>

For the app to work out of the box, you will want to copy the Shopify data format used in this app: Segment Demo eCommerce Store.

About

This application demonstrates how to integrate the Segment react-native library with a mobile application running on Android and iOS. This application also uses the Shopify GraphQL APIs.

License:MIT License


Languages

Language:JavaScript 89.6%Language:Objective-C 6.6%Language:Java 1.7%Language:Python 1.4%Language:Ruby 0.8%