3.7.0 • Published 21 days ago

customerio-reactnative v3.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

npm version npm downloads min Android SDK version is 21 min ios version is 13 min swift version is 5.3 Contributor Covenant

Customer.io React Native SDK

This is the official Customer.io SDK for React Native.

You'll find our complete SDK documentation at https://customer.io/docs/sdk/react-native. This readme only contains basic information to help you install and initialize the SDK.

Install and initialize the SDK

  1. Open your terminal and run npm install customerio-reactnative
  2. Add iOS dependencies to your project by going to the iOS subfolder and running pod install.

    Make sure your deployment target is set to at least 13.0. Before you perform this step, you may want to update your podfile to support APNs and/or FCM push notifications and rich push respectively.

  3. For Android, include google-services-plugin by adding the following lines to the project-level android/build.gradle file:

    buildscript {
       repositories {
          // Add this line if it isn't already in your build file:
          google()  // Google's Maven repository
       }
    
       dependencies {
          // Add this line:
          classpath 'com.google.gms:google-services:<version-here>'  // Google Services plugin
       }
    }
    
    allprojects {
       repositories {
          // Add this line if it isn't already in your build file:
          google()  // Google's Maven repository
       }
    }
  4. Add the following line to android/app/build.gradle:

    apply plugin: 'com.google.gms.google-services'  // Google Services plugin
  5. Download google-services.json from your Firebase project and copy the file to android/app/google-services.json.

  6. Return to the main folder and run your application:

    • iOS: npx react-native run-ios
    • Android: npx react-native run-android
  7. Add an import statement to your project for the react native library. We haven't included it below, but you can import CioLogLevel to set log outputs to something other than error; this may help you debug your application.

    import { CustomerIO, CustomerioConfig, CustomerIOEnv, CioLogLevel, Region } from 'customerio-reactnative';
  8. In useEffect, initialize the package with your CustomerioConfig options and CustomerIOEnv variables. You can find your Site ID and API Key credentials—or create new ones—under Data & Integrations > Integrations > Customer.io API:

    useEffect(() => {
       const data = new CustomerioConfig()
       data.logLevel = CioLogLevel.debug
       // In-app messages are optional and disabled by default
       // To enable in-app messages, set enableInApp to true
       data.enableInApp = true
    
       const env = new CustomerIOEnv()
       env.siteId = Env.siteId
       env.apiKey = Env.apiKey
       // Region is optional, defaults to Region.US. Use Region.EU for EU-based workspaces.
       env.region = Region.US
    
       CustomerIO.initialize(env, data) 
    }, [])

More information

See our complete SDK documentation at https://customer.io/docs/sdk/react-native/

Contributing

Thanks for taking an interest in our project! We welcome your contributions. Check out our development instructions to get your environment set up and start contributing.

We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our code of conduct.

License

MIT

3.7.0

21 days ago

3.6.0

29 days ago

3.5.4

1 month ago

3.5.3

2 months ago

3.5.2

2 months ago

3.5.1

2 months ago

3.5.0

3 months ago

3.4.0

3 months ago

3.1.12

7 months ago

3.1.11

7 months ago

3.1.13

7 months ago

3.1.10

8 months ago

3.1.9

8 months ago

3.1.8

8 months ago

3.2.1

6 months ago

3.2.0

7 months ago

3.3.1

6 months ago

3.1.3

10 months ago

3.3.0

6 months ago

3.1.2

10 months ago

3.1.1

10 months ago

3.1.7

10 months ago

3.1.6

10 months ago

3.1.5

10 months ago

3.3.2

6 months ago

3.1.4

10 months ago

2.5.1

10 months ago

3.1.0

10 months ago

3.0.0

10 months ago

2.5.0

11 months ago

2.4.1

11 months ago

2.4.0

11 months ago

2.4.2

11 months ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.3

1 year ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0-alpha.1

1 year ago

2.0.0-beta.1

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.3

2 years ago

1.0.1-alpha.2

1 year ago

1.0.1-alpha.1

2 years ago

1.0.1-alpha.3

1 year ago

1.0.0-alpha.6

2 years ago

1.0.0-beta.1

2 years ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago