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)
  • SDK Functionality
Documentation for version v75

SDK Functionality

Working with subscription statuses​


Changing subscription status​

AltcraftSDK (React Native)
└─ pushSubscriptionFunctions
// Subscribe (status = SUBSCRIBED)
├─ function pushSubscribe(
│ sync: boolean | null = true,
│ profileFields: Record<string, unknown> | null = null,
│ customFields: Record<string, unknown> | null = null,
│ cats: CategoryData[] | null = null,
│ replace: boolean | null = null,
│ skipTriggers: boolean | null = null
│ ): void
// Suspend (status = SUSPENDED)
├─ function pushSuspend(
│ sync: boolean | null = true,
│ profileFields: Record<string, unknown> | null = null,
│ customFields: Record<string, unknown> | null = null,
│ cats: CategoryData[] | null = null,
│ replace: boolean | null = null,
│ skipTriggers: boolean | null = null
│ ): void
// Unsubscribe (status = UNSUBSCRIBED)
└─ function pushUnSubscribe(
sync: boolean | null = true,
profileFields: Record<string, unknown> | null = null,
customFields: Record<string, unknown> | null = null,
cats: CategoryData[] | null = null,
replace: boolean | null = null,
skipTriggers: boolean | null = null
): void
  • function pushSubscribe() — subscribes to push notifications;
  • function pushUnSubscribe() — unsubscribes from push notifications;
  • function pushSuspend() — suspends the push subscription (no notifications are delivered, but no unsubscribe event is created in the user profile);
  • function unSuspendPushSubscription() — used to implement LogIn / LogOut transitions.

All functions in this group share the same signature and parameters:


sync: Boolean

Default: true
Required: No
Description: A flag that sets whether the request is executed synchronously.

Successful request execution:

On success, an event with code 230, 231, or 232 is created. Its event.value depends on the sync flag:

If sync == true
ResponseWithHttpCode
├─ httpCode: 200
└─ response
├─ error: 0
├─ errorText: ""
└─ profile
├─ id: "your id"
├─ status: "subscribed"
├─ isTest: false
└─ subscription
├─ subscriptionId: "your subscriptionId"
├─ hashId: "7f31a9c4"
├─ provider: "android-firebase"
├─ status: "subscribed"
├─ fields
│ ├─ _os_ver: "{\"raw\":\"14\",\"ver\":\"[\\\"14.0\\\", \\\"0.0\\\", \\\"0.0\\\"]\"}"
│ ├─ _device_type: "mob"
│ ├─ _ad_track: "true"
│ ├─ _device_name: "Pixel"
│ ├─ _os_language: "en"
│ ├─ _os_tz: "+0100"
│ ├─ _os: "Android"
│ ├─ _device_model: "Pixel 7"
│ └─ _app_ver: "1.0.0"
└─ cats
└─ [ { name: "developer_news", title: "dev_news", steady: false, active: false } ]

For synchronous requests, the event value event.value["response_with_http_code"] contains:

  • httpCode — transport-level status code;

  • response — an export type containing:

    • error: number | null — internal server error code (0 if no errors),

    • errorText: string | null — error text (empty string if no errors),

    • profile: ProfileData | null — profile data if the request is successful:

      • profile info (ProfileData)
      • subscription (Subscription)
      • if the request fails, only profile = null is returned
export type
export type Response = {
error?: number | null;
errorText?: string | null;
profile?: ProfileData | null;
};

export type ProfileData = {
id?: string | null;
status?: string | null;
isTest?: boolean | null;
subscription?: Subscription | null;
};

export type CategoryData = {
name?: string | null;
title?: string | null;
steady?: boolean | null;
active?: boolean | null;
};
If sync == false
ResponseWithHttpCode
├─ httpCode: number | null
└─ response: Response | null
├─ error?: number | null
├─ errorText?: string | null
└─ profile?: ProfileData | null // always null

For asynchronous requests, the event value event.value["response_with_http_code"] contains:

  • httpCode — transport-level status code;

  • response — an export type containing:

    • error: number | null — internal server error code (0 if no errors),
    • errorText: string | null — error text (empty string if no errors),
    • profile: ProfileData | null — always null for async requests.

Failed request execution:

If a request in this group fails, an event with one of the following codes is created:

Operations without automatic retry on the SDK side:

  • 430 – notification subscription;
  • 431 — subscription suspension;
  • 432 — unsubscription.

Operations with automatic retry on the SDK side:

  • 530 – notification subscription;
  • 531 — subscription suspension;
  • 532 — unsubscription.

Event contents:

  • only httpCode if the Altcraft server was unavailable;
  • error and errorText if the server returned an error.
Retrieving event values
const RESPONSE_CODES = new Set<number>([
230, 231, 232,
430, 431, 432,
531, 532, 533,
]);

subscribeToEvents((event: SdkEvent) => {
if (event.code == null) return;
if (!RESPONSE_CODES.has(event.code)) return;

const raw = event.value?.['response_with_http_code'] as unknown;
const responseWithHttp = raw as ResponseWithHttpCode | null;
if (!responseWithHttp) return;

const httpCode = responseWithHttp.httpCode;

const response = responseWithHttp.response;
const error = response?.error ?? null;
const errorText = response?.errorText ?? null;

const profile = response?.profile ?? null;
const profileId = profile?.id ?? null;
const profileStatus = profile?.status ?? null;
const profileIsTest = profile?.isTest ?? null;

const subscription = profile?.subscription ?? null;
const subscriptionId = subscription?.subscriptionId ?? null;
const hashId = subscription?.hashId ?? null;
const provider = subscription?.provider ?? null;
const subscriptionStatus = subscription?.status ?? null;

const fields = subscription?.fields ?? null;

const cats = subscription?.cats ?? null;
const firstCat = cats?.[0] ?? null;
const catName = firstCat?.name ?? null;
const catTitle = firstCat?.title ?? null;
const catSteady = firstCat?.steady ?? null;
const catActive = firstCat?.active ?? null;
});

profileFields:Record<string, unknown> | null

Default: null
Required: No
Description: An object containing profile fields.

The parameter can include system fields (for example, _fname — first name, _lname — last name) and optional fields (manually created in the platform UI beforehand). Allowed JSON-compatible structures:

  • Scalar values:

    • String
    • Boolean
    • Number
    • null
  • Objects: Record<string, unknown>

  • Lists: unknown[]

If an invalid optional field is passed, the request fails:

SDK error: 430
http code: 400
error: 400
errorText: Platform profile processing error: with field "field_name": Incorrect field

customFields:Record<string, unknown> | null

Default: null
Required: No
Description: An object containing subscription fields.

The parameter can include system fields (for example, _device_model — device model, _os — OS) and optional fields (manually created in the platform UI beforehand). Allowed value types (JSON-compatible, scalars only):

  • String
  • Boolean
  • Number
  • null

If an invalid optional field is passed, the request fails:

SDK error: 430
http code: 400
error: 400
errorText: Platform profile processing error: field "field_name" is not valid: failed convert custom field
Note

Most system subscription fields are automatically collected by the SDK and added to push requests. These include: "_os", "_os_tz", "_os_language", "_device_type", "_device_model", "_device_name", "_os_ver", "_ad_track", "_ad_id".


cats:CategoryData[] | null

Default: null
Required: No
Description: Subscription categories.

Category structure:

export type CategoryData = {
name?: string | null;
title?: string | null;
steady?: boolean | null;
active?: boolean | null;
};

When sending a push request with categories, use only name (category name) and active (category active status). Other fields are not used in request processing. The title and steady fields are populated when retrieving subscription info.

Request example:

const cats: CategoryData[] = [
{ name: 'football', active: true },
{ name: 'hockey', active: true },
];

Categories used in the request must be created beforehand and added to the resource in the Altcraft platform. If a category not present in the resource is used, the request returns an error:

SDK error: 430
http code: 400
error: 400
errorText: Platform profile processing error: field "subscriptions.cats" is not valid: category not found in resource

replace:boolean | null

Default: null
Required: No
Description: When enabled, all subscriptions of other profiles with the same push token in the current database are set to unsubscribed after a successful request.


skipTriggers:boolean | null

Default: null
Required: No
Description: When enabled, the profile containing this subscription will be ignored by mailing and scenario triggers.


Request examples

Example: subscribing to push notifications

Minimal working call:

AltcraftSDK.pushSubscribe();

Passing all available parameters:

AltcraftSDK.pushSubscribe(
true,
{ _fname: 'Andrey', _lname: 'Pogodin' },
{ developer: true },
[{ name: 'developer_news', active: true }],
false,
false
);
Note

For pushSubscribe, pushSuspend, and pushUnSubscribe, the SDK automatically retries the request if the HTTP status code is in the 500..599 range. No retry occurs if the code is outside this range.


Function unSuspendPushSubscription()

The function async function unSuspendPushSubscription(): Promise<ResponseWithHttpCode | null> is designed for LogIn / LogOut transitions. It works as follows:

  • searches for subscriptions with the same push token as the current one that do not belong to the profile referenced by the current JWT;
  • changes the status of the found subscriptions from subscribed to suspended;
  • changes the status of the subscriptions in the profile referenced by the current JWT from suspended to subscribed (if that profile exists and contains subscriptions);
  • returns ResponseWithHttpCode | null, where response.profile is the current profile referenced by the JWT (if the profile does not exist, response.profile is null).
Recommended LogIn / LogOut flow

LogIn flow

  • An anonymous user opens the app. The user has JWT_1, pointing to database #1Anonymous;
  • The user subscribes to push; a profile is created in #1Anonymous;
  • The user registers and receives JWT_2, pointing to database #2Registered;
  • Call unSuspendPushSubscription() — the anonymous subscription in #1Anonymous is suspended;
  • The SDK searches for a profile in #2Registered to restore the subscription;
  • Since a subscription with this push token does not exist in #2Registered, unSuspendPushSubscription() returns null;
  • After receiving null, call pushSubscribe() to create a new profile in #2Registered.

LogOut flow

  • The user logs out in the app (LogOut);
  • The user receives JWT_1, pointing to database #1Anonymous;
  • Call unSuspendPushSubscription(), which suspends the subscription in #2Registered and sets the status in #1Anonymous to subscribed;
  • The request returns profile #1Anonymous != null — the subscription already exists, no new one is required.

Example implementation:

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

async function unSuspend(logIn: boolean): Promise<void> {
setAuth(logIn);

const result: ResponseWithHttpCode | null =
await AltcraftSDK.unSuspendPushSubscription();

if (!result) {
AltcraftSDK.pushSubscribe();
return;
}

const httpCode = result.httpCode ?? null;
const subscription = result.response?.profile?.subscription ?? null;

if (httpCode === 200 && subscription == null) {
AltcraftSDK.pushSubscribe();
}
}

export function logIn(): void {
void unSuspend(true);
}

export function logOut(): void {
void unSuspend(false);
}

Requesting subscription status​

AltcraftSDK
└── function getStatusOfLatestSubscription(): Promise<ResponseWithHttpCode | null>
└── function getStatusForCurrentSubscription(): Promise<ResponseWithHttpCode | null>
└── function getStatusOfLatestSubscriptionForProvider(
provider: string | null
): Promise<ResponseWithHttpCode | null>

Subscription status functions:

  • function getStatusOfLatestSubscription() — status of the profile’s latest subscription;
  • function getStatusForCurrentSubscription() — subscription status for the current token/provider;
  • function getStatusOfLatestSubscriptionForProvider() — status of the latest subscription for a provider. If null is specified, the current token’s provider is used.

function getStatusOfLatestSubscription(): Promise<ResponseWithHttpCode | null>

Retrieves the status of the profile’s latest subscription. Returns ResponseWithHttpCode | null, containing response?.profile?.subscription — the most recently created subscription in the profile. If no such subscription exists, null is returned.

Example:

const result = await AltcraftSDK.getStatusOfLatestSubscription();

function getStatusForCurrentSubscription(): Promise<ResponseWithHttpCode | null>

Retrieves the subscription status for the current token/provider. Returns ResponseWithHttpCode | null, containing response?.profile?.subscription — the subscription found by the current push token and provider. If no such subscription exists, null is returned.

Example:

const result = await AltcraftSDK.getStatusForCurrentSubscription();

function getStatusOfLatestSubscriptionForProvider(provider: string | null): Promise<ResponseWithHttpCode | null>

Retrieves the latest subscription status by provider. Returns ResponseWithHttpCode | null, containing response?.profile?.subscription — the most recently created subscription for the specified provider. If no provider is specified (provider = null), the current token’s provider is used. If no such subscription exists, null is returned.

Example:

const result = await AltcraftSDK.getStatusOfLatestSubscriptionForProvider(null);

Below is an example of extracting profile, subscription, and category data from the status response. This approach applies to all status-retrieval functions:

Data from status-retrieval functions
import AltcraftSDK from '@altcraft/react-native-sdk';

async function readStatus(): Promise<void> {
const result = await AltcraftSDK.getStatusForCurrentSubscription();
if (!result) return;

const httpCode = result.httpCode ?? null;

const response = result.response ?? null;
const error = response?.error ?? null;
const errorText = response?.errorText ?? null;

const profile = response?.profile ?? null;
const subscription = profile?.subscription ?? null;

const cats = subscription?.cats ?? null;
}

Provider push token management​


AltcraftSDK
|
└─ // Get current device token data
├── function getPushToken(): Promise<TokenData | null>
|
| // Save/update token manually for a specific provider
└── function setPushToken(provider: string, token: string | null): Promise<void>

SDK functions for working with a provider token:

  • function setPushToken() — sets the device push token and provider;
  • function getPushToken() — retrieves the current push token.

setPushToken(provider, token)

Sets the device push token and provider.

  • In React Native, context is not passed — token storage and persistence are handled on the native side of the SDK.
  • token: null clears the token for the specified provider.

Usage example:

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

await AltcraftSDK.setPushToken('FCM', token);

Example of passing a token when a new token is received:

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

async function onNewToken(provider: string, token: string) {
await AltcraftSDK.setPushToken(provider, token);
}

getPushToken()

Returns the current device push token data and provider as TokenData.

Return format:

  • TokenData — an object with:

    • provider: string
    • token: string

If the token is unavailable, null is returned.

Usage example:

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

const tokenData = await AltcraftSDK.getPushToken();

Example of requesting push token data:

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

async function readPushToken() {
const data = await AltcraftSDK.getPushToken();

const provider = data?.provider ?? null;
const token = data?.token ?? null;

return { provider, token };
}

Provider push token management​


AltcraftSDK
|
└─ // Get current device token data
├── function getPushToken(): Promise<TokenData | null>
|
| // Save/update token manually for a specific provider
└── function setPushToken(provider: string, token: string | null): Promise<void>

SDK functions for working with a provider token:

  • function setPushToken() — sets the device push token and provider;
  • function getPushToken() — retrieves the current push token.

setPushToken(provider, token)

Sets the device push token and provider.

  • In React Native, context is not passed — token storage and persistence are handled on the native side of the SDK.
  • token: null clears the token for the specified provider.

Usage example:

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

await AltcraftSDK.setPushToken('FCM', token);

Example of passing a token when a new token is received:

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

async function onNewToken(provider: string, token: string) {
await AltcraftSDK.setPushToken(provider, token);
}

getPushToken()

Returns the current device push token data and provider as TokenData.

Return format:

  • TokenData — an object with:

    • provider: string
    • token: string

If the token is unavailable, null is returned.

Usage example:

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

const tokenData = await AltcraftSDK.getPushToken();

Example of requesting push token data:

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

async function readPushToken() {
const data = await AltcraftSDK.getPushToken();

const provider = data?.provider ?? null;
const token = data?.token ?? null;

return { provider, token };
}

Mobile events​

// AltcraftSDK object function (React Native)

AltcraftSDK
└── function mobileEvent(
sid: string,
eventName: string,
sendMessageId?: string | null,
payload?: Record<string, unknown> | null,
matching?: Record<string, unknown> | null,
matchingType?: string | null,
profileFields?: Record<string, unknown> | null,
subscription?: Subscription | null,
utm?: UTM | null
): void

Use the mobileEvent() function from AltcraftSDK to register a mobile event. The function accepts the following parameters:


sid: string

Required: Yes Description: String identifier of the pixel to which mobile events are bound.


eventName: string

Required: Yes Description: Name of the mobile event.


sendMessageId: string | null

Required: No Description: SMID identifier of the sent message (if the event is related to a specific mailing).


payload: Record<string, unknown> | null

Required: No Description: Event data — a map with string keys. In the RN bridge, values are serialized to string:

  • string — passed as is
  • number / boolean / bigint — String(value)
  • object / array — JSON.stringify(value)
  • null / undefined — the key is not passed (the field is removed from payload)
Note

Non-serializable objects (for example, Date without conversion, custom classes, functions) are passed as strings via String(value) or may result in incorrect data. Pass JSON-compatible values.


matching: Record<string, unknown> | null

Required: No Description: Map for passing values with matching types and identifiers (for example, {"email": "user@example.com"}). In the RN bridge, values are serialized to string using the same rules as for payload.


matchingType: string | null

Required: No Description: Matching type.


profileFields: Record<string, unknown> | null

Required: No Description: Profile fields — a map with string keys. In the RN bridge, values are serialized to string using the same rules as for payload.

Note

The profileFields parameter is used only when JWT authorization is enabled.


subscription: Subscription | null

Required: No Description: Parameter for adding a subscription for the selected channel.

The parameter value is one of the implementations of the Subscription union type:

  • EmailSubscription — email subscription
  • SmsSubscription — SMS subscription
  • PushSubscription — push subscription
  • CcDataSubscription — subscription for Telegram, WhatsApp, Viber, Notify
Note

The subscription parameter is used only when JWT authorization is enabled.

Common subscription fields (for all implementations)

FieldTypeRequiredDescription
typestringYesChannel type (discriminator).
resource_idnumberYesResource/source subscription ID.
statusstring | nullNoSubscription status (for example, active/suspended).
prioritynumber | nullNoDelivery priority.
custom_fields{ [key: string]: string } | nullNoCustom subscription fields.
catsstring[] | nullNoSubscription categories.

Subscription variants

EmailSubscription (type = "email")

FieldTypeRequiredDescription
resource_idnumberYesAltcraft resource ID
emailstringYesEmail address

SmsSubscription (type = "sms")

FieldTypeRequiredDescription
resource_idnumberYesAltcraft resource ID
phonestringYesPhone number in international format

PushSubscription (type = "push")

FieldTypeRequiredDescription
resource_idnumberYesAltcraft resource ID
providerstringYesProvider (for example, "android-firebase")
subscription_idstringYesProvider subscription unique identifier

CcDataSubscription (type = "cc_data")

FieldTypeRequiredDescription
resource_idnumberYesAltcraft resource ID
channelstringYesOne of: "telegram_bot", "whatsapp", "viber", "notify"
cc_data{ [key: string]: string }YesChannel-specific data (for example, chat ID, phone number, tokens)

utm: UTM | null

Required: No Description: UTM tags. Passed as a UTM structure, where each UTM type is a separate field:

export type UTM = {
campaign?: string | null;
content?: string | null;
keyword?: string | null;
medium?: string | null;
source?: string | null;
temp?: string | null;
};

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

AltcraftSDK.mobileEvent('your sid', 'app_open');

Passing data via payload

AltcraftSDK.mobileEvent(
'your sid',
'purchase',
null,
{
orderId: 'A-1001',
amount: 3990,
currency: 'RUB',
items: [{ sku: 'sku-1', qty: 2 }],
}
);

Passing UTM tags

AltcraftSDK.mobileEvent(
'your sid',
'app_install',
null,
null,
null,
null,
null,
null,
{
campaign: 'your campaign utm',
content: 'your content utm',
keyword: 'your keyword utm',
medium: 'your medium utm',
source: 'your source utm',
temp: 'your temp utm',
}
);

Passing matching / matchingType

AltcraftSDK.mobileEvent(
'your sid',
'profile_update',
null,
{ source: 'settings' },
{ email: 'user@example.com' },
'email'
);

*Passing subscription (JWT)

import type { PushSubscription } from '@altcraft/react-native-sdk';

const sub: PushSubscription = {
type: 'push',
resource_id: 10,
provider: 'android-firebase',
subscription_id: 'provider-sub-id',
status: 'active',
priority: 1,
custom_fields: { utm: 'your utm tag' },
cats: ['promo', 'news'],
};

AltcraftSDK.mobileEvent(
'your sid',
'jwt_bind_subscription',
null,
null,
null,
null,
null,
sub,
null
);
Note

When passing subscription via the RN bridge, some fields are serialized to strings (for example, custom_fields and cats are passed as JSON strings). Pass JSON-compatible values.


Receiving SDK events in the app​


In React Native, SDK events are passed from the native layer via NativeEventEmitter. Only one active subscriber to SDK events can exist in the app.

Events are emitted under the name AltcraftSdkEvent. Each event received in JS has the following format:

export type SdkEvent = {
function: string; // SDK function name
code: number | null; // event code
message: string; // event message
type: 'event' | 'error' | 'retryError';
value?: Record<string, unknown> | null; // extra payload
};

Event types:

  • event — informational events and successful operations;
  • error — execution errors;
  • retryError — errors of operations that the SDK retries automatically.

Subscribing to events​

To subscribe, use subscribeToEvents.

When you subscribe again, the previous subscriber is automatically removed.

import AltcraftSDK, { subscribeToEvents } from 'altcraft-react-native-sdk';

subscribeToEvents((event) => {
switch (event.type) {
case 'event':
// handle success event
break;

case 'error':
// handle error
break;

case 'retryError':
// handle retryable error
break;
}
});

Unsubscribing from events​

To stop receiving events, use unsubscribeFromEvent.

import { unsubscribeFromEvent } from 'altcraft-react-native-sdk';

unsubscribeFromEvent();

After calling it, the subscriber is removed and SDK events are no longer delivered to JavaScript.


List of all SDK events​

Event list
CodeDescription
200SDK configuration is installed
201push provider set
202received a notification unrelated to the Altcraft Platform
203received Altcraft push notification
204push is posted
205SDK data has been cleared
206waiting for SDK initialization to complete
207waiting for push token update to complete
220receiver override event
230subscribe request succeeded
231push suspend request succeeded
232push unsubscribed request succeeded
233push update request succeeded
234push unsuspend request succeeded
235profile status request succeeded
236push event delivered successfully
237mobile event delivered successfully
401the configuration is not set
402userTag is null. It is impossible to identify the user
404SDK initialization timeout has expired
405mobile event parts is null
422unsuspend request data is null
423profile request data is null
430subscribe request failed
431suspend request failed
432unsubscribed request failed
433update request failed
434unsuspend request failed
435status request failed
436push event delivery failed
437mobile event request failed
450push data is null
451uid in the push data is null or empty, it is impossible to send a push event to the server
452error uploading the notification image
453couldn't create notification
454foreground info is null
455the notification channel has not been created
471invalid provider. Available - android-firebase, android-huawei, android-rustore
472invalid customFields: not all values are primitives
480subscribe retry limit reached (request removed from DB)
484push event retry limit reached (request removed from DB)
485mobile event retry limit reached (request removed from DB)
501config data is null
502current push token is null
503userTag is null. It is impossible to identify the user
504no permission to send notifications
505no internet connection, retry when connection is restored
506failed to update the push token. The subscription request was rejected
520push subscribe request data is null
521token update request data is null
524push event request data is null
525mobile event request data is null
529common data is null
530subscribe request failed (retryable)
531token update request failed (retryable)
534push event delivery failed (retryable)
535mobile event delivery failed (retryable)
540JWT token is null
541matching mode is null
542JWT payload exceeds allowed size (16 KB limit): input rejected to prevent DoS
543JWT does not contain a payload
544auth data is null
545matching claim does not contain a matching ID
560response data is null

Additional SDK functions​


Clearing SDK data​

AltcraftSDK.clear();

The function clears SDK data and cancels all background tasks that are waiting to be executed.


Manual push event registration​

Note

Use these functions only if you implement your own notification handling logic and do not pass notifications to the SDK automatically.

Android​

In React Native, manual push event registration functions are available on the JS side:

  • deliveryEvent(message?: Record<string, string> | null, messageUID?: string | null) — registers notification delivery;
  • openEvent(message?: Record<string, string> | null, messageUID?: string | null) — registers notification open.

Parameters:

  • message: Record<string, string> | null — notification data payload as a dictionary of strings.
  • messageUID: string | null — message identifier.

Passing rules:

  • you can pass only message (the SDK will take the message ID from the payload if it exists there);
  • you can pass only messageUID (if the payload is unavailable but the ID is known);
  • if both parameters are null, the event will not be registered correctly (no data to identify the message).

iOS​

Manual push event registration on the React Native side is not implemented. If manual event registration is required, implement it in the native part of the app.

See the iOS guide (manual push event registration).

Last updated on Jan 12, 2026
Previous
SDK Configuration
Next
Public SDK API
  • Working with subscription statuses
    • Changing subscription status
    • Requesting subscription status
  • Provider push token management
  • Provider push token management
  • Mobile events
  • Receiving SDK events in the app
    • Subscribing to events
    • Unsubscribing from events
    • List of all SDK events
  • Additional SDK functions
    • Clearing SDK data
    • Manual push event registration
      • Android
      • iOS
© 2015 - 2025 Altcraft, LLC. All rights reserved.