If you have multiple apps, pass your app identifier as the optional last argument of init so that the app's sessions, user data, and push notification targeting are attributed to the correct app.
This parameter is available on React Native SDK 9.0.0 or higher. Expo projects use the same react-native-insider API.
App identifier format
Your app identifier is provided by Insider One. It must follow these rules:
Only lowercase letters (a-z), digits (0-9), and underscores (_).
Must start with a lowercase letter or a digit.
At most 50 characters. Pattern: ^[a-z0-9][a-z0-9_]{0,49}$
Bundle-identifier style values such as com.acme.myapp are not valid.
An invalid app identifier does not block initialization. The SDK logs a warning, ignores the value, and initializes as if no app identifier was passed. In that case, the app's data is attributed to the partner's default app.
The following table shows the data type for the method's parameters.
Parameter | Data Type | Description |
|---|---|---|
partnerName | string | Your partner name provided by Insider One. |
appGroup | string | Your iOS App Group. Pass any value on Android. |
insiderCallback | Function | The (type, data) callback handler. |
appIdentifier | string (optional) | Your app identifier provided by Insider One. Must match ^[a-z0-9][a-z0-9_]{0,49}$. |
Method signature
static init(
partnerName: string,
appGroup: string,
insiderCallback: Function,
appIdentifier?: string
): void;Method example
import Insider from 'react-native-insider';
import InsiderCallbackType from 'react-native-insider/src/InsiderCallbackType';
function onInsiderCallback(type, data) {
switch (type) {
case InsiderCallbackType.NOTIFICATION_OPEN:
// Handle push tap.
break;
}
}
Insider.init(
'your_partner_name',
'group.com.your-company.your-app',
onInsiderCallback,
'your_app_identifier',
);Initialization behavior
Omit the argument (or pass an empty string) to initialize without an app identifier. Nothing about your existing integration changes.
A non-string value logs a warning and is ignored.
The plugin passes the value to the native SDKs, which validate it. An invalid value is logged and ignored, and initialization still completes.
reinitWithPartnerName with a different partner name clears the app identifier on both platforms. Calling it with the same partner name keeps it.