Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v75
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Mailings
  • Automation scenarios
  • Loyalty Programs
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDev
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
    • mSDK
      • Android
      • iOS
      • React Native (Android/iOS)
        • Quick Start
        • SDK Configuration
        • SDK Functionality
        • Public SDK API
        • Provider setup
      • Managing JWT and Role Token
  • SDK
  • mSDK
  • React Native (Android/iOS)
  • Quick Start
Documentation for version v75

Quick Start

This article provides an example of quick integration of Altcraft mSDK for React Native.


Step 0. Prerequisites​

  • A React Native project is created and runs on iOS/Android.

  • Native push providers are integrated into the project:

    • Android: FCM, HMS, RuStore
    • iOS: APNS, FCM, HMS
  • Altcraft mSDK is configured on the native side:

    • providers are registered (JWT / APNS / FCM / HMS / RuStore);
    • interception of incoming push notifications and their forwarding to the SDK is configured.

Step 1. Package installation​

npm i @altcraft/react-native-sdk
# or
yarn add @altcraft/react-native-sdk

Step 2. SDK configuration and initialization​

Import the SDK and initialize it at app startup (for example, in App.tsx):

import AltcraftSDK from '@altcraft/react-native-sdk';

AltcraftSDK.initialize({
apiUrl: 'https://pxl-your-instance.altcraft.com',
rToken: null,
appInfo: {
appID: 'your-app-id',
appIID: 'your-installation-id',
appVer: '1.0.0',
},
providerPriorityList: null,
enableLogging: true,

// -------- ANDROID-ONLY (optional) --------
android_icon: null,
android_usingService: null,
android_serviceMessage: null,
android_pushReceiverModules: null,
android_pushChannelName: null,
android_pushChannelDescription: null,
});

Step 3. Subscribing to push notifications​

Push subscription is performed by calling pushSubscribe():

import AltcraftSDK from '@altcraft/react-native-sdk';

AltcraftSDK.pushSubscribe(
true,
{ _fname: 'user_first_name', _lname: 'user_last_name' }, // profileFields
null, // customFields
null, // cats
null, // replace
null // skipTriggers
);
  • sync: true — performs the request synchronously (the result can be obtained via an SDK event if supported by the platform).
  • sync: false — performs the request asynchronously.

(Optional) Subscribing to SDK events​

To receive call results and internal SDK events, use subscribeToEvents():

import AltcraftSDK, { type SdkEvent } from '@altcraft/react-native-sdk';

AltcraftSDK.subscribeToEvents((event: SdkEvent) => {
// event.function — name of the SDK function that triggered the event
// event.type — 'event' | 'error' | 'retryError'
// event.code / event.message — event code and message
// event.value — additional data (if any)
console.log('[AltcraftSDK event]', event);
});

To unsubscribe:

AltcraftSDK.unsubscribeFromEvent();
Last updated on Sep 25, 2025
Previous
React Native (Android/iOS)
Next
SDK Configuration
  • Step 0. Prerequisites
  • Step 1. Package installation
  • Step 2. SDK configuration and initialization
  • Step 3. Subscribing to push notifications
  • (Optional) Subscribing to SDK events
© 2015 - 2025 Altcraft, LLC. All rights reserved.