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 implementLogIn/LogOuttransitions.
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 = nullis 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— alwaysnullfor 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
httpCodeif the Altcraft server was unavailable; erroranderrorTextif 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
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
);
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
subscribedtosuspended; - changes the status of the subscriptions in the profile referenced by the current JWT from
suspendedtosubscribed(if that profile exists and contains subscriptions); - returns
ResponseWithHttpCode | null, whereresponse.profileis the current profile referenced by the JWT (if the profile does not exist,response.profileisnull).
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()returnsnull; - After receiving
null, callpushSubscribe()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 tosubscribed; - 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. Ifnullis 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,
contextis not passed — token storage and persistence are handled on the native side of the SDK. token: nullclears 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: stringtoken: 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,
contextis not passed — token storage and persistence are handled on the native side of the SDK. token: nullclears 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: stringtoken: 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 isnumber/boolean/bigint—String(value)object/array—JSON.stringify(value)null/undefined— the key is not passed (the field is removed from payload)
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.
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 subscriptionSmsSubscription— SMS subscriptionPushSubscription— push subscriptionCcDataSubscription— subscription for Telegram, WhatsApp, Viber, Notify
The subscription parameter is used only when JWT authorization is enabled.
Common subscription fields (for all implementations)
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Channel type (discriminator). |
resource_id | number | Yes | Resource/source subscription ID. |
status | string | null | No | Subscription status (for example, active/suspended). |
priority | number | null | No | Delivery priority. |
custom_fields | { [key: string]: string } | null | No | Custom subscription fields. |
cats | string[] | null | No | Subscription categories. |
Subscription variants
EmailSubscription (type = "email")
| Field | Type | Required | Description |
|---|---|---|---|
resource_id | number | Yes | Altcraft resource ID |
email | string | Yes | Email address |
SmsSubscription (type = "sms")
| Field | Type | Required | Description |
|---|---|---|---|
resource_id | number | Yes | Altcraft resource ID |
phone | string | Yes | Phone number in international format |
PushSubscription (type = "push")
| Field | Type | Required | Description |
|---|---|---|---|
resource_id | number | Yes | Altcraft resource ID |
provider | string | Yes | Provider (for example, "android-firebase") |
subscription_id | string | Yes | Provider subscription unique identifier |
CcDataSubscription (type = "cc_data")
| Field | Type | Required | Description |
|---|---|---|---|
resource_id | number | Yes | Altcraft resource ID |
channel | string | Yes | One of: "telegram_bot", "whatsapp", "viber", "notify" |
cc_data | { [key: string]: string } | Yes | Channel-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
);
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
| Code | Description |
|---|---|
| 200 | SDK configuration is installed |
| 201 | push provider set |
| 202 | received a notification unrelated to the Altcraft Platform |
| 203 | received Altcraft push notification |
| 204 | push is posted |
| 205 | SDK data has been cleared |
| 206 | waiting for SDK initialization to complete |
| 207 | waiting for push token update to complete |
| 220 | receiver override event |
| 230 | subscribe request succeeded |
| 231 | push suspend request succeeded |
| 232 | push unsubscribed request succeeded |
| 233 | push update request succeeded |
| 234 | push unsuspend request succeeded |
| 235 | profile status request succeeded |
| 236 | push event delivered successfully |
| 237 | mobile event delivered successfully |
| 401 | the configuration is not set |
| 402 | userTag is null. It is impossible to identify the user |
| 404 | SDK initialization timeout has expired |
| 405 | mobile event parts is null |
| 422 | unsuspend request data is null |
| 423 | profile request data is null |
| 430 | subscribe request failed |
| 431 | suspend request failed |
| 432 | unsubscribed request failed |
| 433 | update request failed |
| 434 | unsuspend request failed |
| 435 | status request failed |
| 436 | push event delivery failed |
| 437 | mobile event request failed |
| 450 | push data is null |
| 451 | uid in the push data is null or empty, it is impossible to send a push event to the server |
| 452 | error uploading the notification image |
| 453 | couldn't create notification |
| 454 | foreground info is null |
| 455 | the notification channel has not been created |
| 471 | invalid provider. Available - android-firebase, android-huawei, android-rustore |
| 472 | invalid customFields: not all values are primitives |
| 480 | subscribe retry limit reached (request removed from DB) |
| 484 | push event retry limit reached (request removed from DB) |
| 485 | mobile event retry limit reached (request removed from DB) |
| 501 | config data is null |
| 502 | current push token is null |
| 503 | userTag is null. It is impossible to identify the user |
| 504 | no permission to send notifications |
| 505 | no internet connection, retry when connection is restored |
| 506 | failed to update the push token. The subscription request was rejected |
| 520 | push subscribe request data is null |
| 521 | token update request data is null |
| 524 | push event request data is null |
| 525 | mobile event request data is null |
| 529 | common data is null |
| 530 | subscribe request failed (retryable) |
| 531 | token update request failed (retryable) |
| 534 | push event delivery failed (retryable) |
| 535 | mobile event delivery failed (retryable) |
| 540 | JWT token is null |
| 541 | matching mode is null |
| 542 | JWT payload exceeds allowed size (16 KB limit): input rejected to prevent DoS |
| 543 | JWT does not contain a payload |
| 544 | auth data is null |
| 545 | matching claim does not contain a matching ID |
| 560 | response 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
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).