Over-the-Air (OTA) Updates
This page explains how to configure the Instabug SDK to track over-the-air (OTA) updates for your React Native application, including support for Expo Updates and the legacy CodePush service.
Overview
Over-the-air (OTA) updates are a great way to deliver new code to your users without requiring a full app store release. To ensure your bug and crash reports are correctly associated with the right code version, Instabug needs to be made aware of these OTA updates.
Configuring Your OTA Version
We provide a single, unified API to track your OTA updates, whether you are using Expo Updates or CodePush.
Requires Instabug React Native SDK version v16.0.0 or higher.
Expo Updates
Instabug provides support for apps using Expo Updates. This allows you to see a specific Expo Update's build ID in all your reports, helping you track issues with precision.
Setup
To track your Expo Updates, pass the overAirVersion
object with the service
and version
parameters during SDK initialization.
import Instabug, { OverAirUpdateServices } from 'instabug-reactnative';
// First, initialize the SDK
Instabug.init({
token: '<YOUR_APP_TOKEN>',
invocationEvents: [InvocationEvent.shake],
});
// Then, set your OTA version
Instabug.setOverAirVersion({
service: OverAirUpdateServices.expo,
version: '<Your-Build-ID>'
});
The service
parameter accepts two enum values:
OverAirUpdateServices.expo
: For teams using Expo Updates.OverAirUpdateServices.codePush
: For teams using CodePush.
construction
Character Limit
The total combined length of your app version and the Expo Update Build ID should not exceed 40 characters. Any characters beyond this limit will be trimmed.
Uploading Sourcemaps
Uploading sourcemaps should work automatically by adding our Expo plugin
instabug-reactnative
in yourapp.json
for standard Expo builds (eas build
).
However, for Expo Updates, you must use the manual CLI command provided below to upload sourcemaps:
Usage: instabug upload-eas-updates-sourcemaps [options]
Options:
-f, --file <path> The path of eas update folder (default: "dist")
-t, --token <value> Your App Token (env: INSTABUG_APP_TOKEN)
-n, --name <value> The app version name (env: INSTABUG_APP_VERSION_NAME)
-c, --code <value> The app version code (env: INSTABUG_APP_VERSION_CODE)
--androidUpdateId <value> The Eas android Update id
--iosUpdateId <value> The Eas ios Update id
CodePush (Legacy)
For teams still using the older codePushVersion
parameter within the Instabug.init
method, it will continue to be supported.
// Deprecated but still supported
Instabug.init({
token: '<User-App-token>',
codePushVersion: '<Code-push-version>',
invocationEvents: [<Invocation-events>],
});
We recommend migrating to the new, unified setOverAirVersion
API for a more consistent approach.
API Precedence
The new API,
setOverAirVersion
, has been created to handle both Expo and CodePush versions.
- It accepts two values:
.expo
or .codePush
- which though deprecated, will continue being supported if called.If you call both the new
setOverAirVersion
API and use the legacycodePushVersion
parameter, the SDK will always honor the most recently called API. For example, if you set thecodePushVersion
and then callsetOverAirVersion
later, the value fromsetOverAirVersion
will be used.
Updated about 8 hours ago