Skip to content

Latest commit

 

History

History
77 lines (48 loc) · 3.1 KB

File metadata and controls

77 lines (48 loc) · 3.1 KB

Development

Getting started

Since this SDK is npm package, it does not need to be compiled separately.

API Change Detection

This project uses Microsoft API Extractor to detect breaking changes to the public API surface.

How it works

  • API Extractor generates a baseline file (api-extractor-output/customerio-reactnative.api.md) containing the current API surface
  • CI validates that this baseline matches the actual exported APIs
  • Any API changes require updating the baseline file and committing it

Local development

After making API changes:

  1. Build TypeScript declarations:

    npm run prepare
  2. Update the API baseline:

    npx api-extractor run --local
  3. Review and commit the updated api-extractor-output/customerio-reactnative.api.md file

To validate without updating:

npx api-extractor run

Work on Ami App locally

We use the Ami App to test the SDK in a real-world environment.

When you install dependencies via yarn/npm in react native app, you can install it from your local machine directly. You need to follow the following steps to use local version of the SDK

  1. Go to package.json of your react native app
  2. Find the SDK dependency i.e. "customerio-reactnative": "{version}"
  3. Update the SDK version to path of the SDK e.g. "customerio-reactnative": "../customerio-reactnative"
  4. Run yarn install to update dependencies and use local version of SDK instead

Android

Android SDK can be tested locally by following instructions from native SDK. Once SDK release is installed locally, it can be included in Ami App using any of the following options:

Option 1: Updating in SDK

Updating gradle.properties to use local version by updating following line:

customerio.reactnative.cioSDKVersionAndroid=local

Option 2: Updating in Ami App

React Native SDK allows overriding SDK version on app side, so Ami App can override the version and use local release instead by adding the following line in gradle.properties

cioSDKVersionAndroid=local

iOS

iOS SDK cannot be tested locally at this time. You must instead refer to a version of the iOS SDK already released to production.

If you make changes to native code, it sometimes may not be reflected in the app. View the Ami App docs for next steps on getting Ami App to install the SDK from your local directory.

Please note that currently there is no script or automation that helps you make the changes, so you should revert the changes in package.json and yarn.lock for local version of customerio-reactnative before pushing any changes to git.