Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    User API documentationAPI interactionMatching
      Profilesarrow
    • Import profileUpdate profileImport multiple profilesUpdate multiple profilesAdd multiple profilesAdd profile to databaseImport profile to RabbitMQGet profile dataUploading profiles to a fileDelete profileSubscription fields functional updateDatabase fields functional updateMerging multiple profilesUnsubscribe profile from resourceProfile splitting
        Subscriptionsarrow
      • Add or edit subscriptionGet all profile subscriptionsGet all subscriptions from multiple profilesGet profile subscriptionDelete profile subscriptionRestore deleted subscriptionSuspend all subscriptionsUnsuspend all suspended subscriptions
        Action historyarrow
      • Get profile action historyGet multiple profiles action history
        Profile relationsarrow
      • Attach relationDetach relationModify relation propertiesOverwrite relation propertiesGet profile relations infoGet profile relations info
      Get data for multiple profiles
      Databasesarrow
    • Get database statisticsUpdate statistics on databaseGet database listGet database informationGet database fieldsDatabase wipe
      Resourcesarrow
    • Get resource statisticsUpdate statistics on resourceGet resources listGet resource informationGet resource subscription fields
      Segmentsarrow
    • Create segmentGet statistics on resourceUpdate statistics on segmentAdd or remove profileGet profile data in a static segmentUpdate segmentGet segment informationGet segments listDelete segment
      Suppression listsarrow
    • Create suppression listUpdate suppression listGet suppression list infoGet the list of suppression listsDelete suppression listUpload suppression list data to file
        Suppression list actionsarrow
      • Check if email is suppressedAdd email to suppression listAdd multiple emails to suppression listRemove email from suppression listRemove all emails from suppression listCheck if domain is suppressedAdd domain to suppression listAdd multiple domains to suppression listRemove domain from suppression listRemove all domains from suppression listCheck if phone number is suppressedAdd phone number to suppression listAdd multiple phones to suppression listRemove phone number from suppression listRemove all phone numbers from suppression list
      Templates and fragmentsarrow
    • Get templates listGet template infoDelete templateAdd templateUpdate templateChannel object
      Campaignsarrow
    • Get campaign informationGet campaign listActivate campaignComplete campaignDeactivate campaignGet campaign status
      Mailingsarrow
    • Activate mailingDeactivate mailingGet mailing listGet mailing informationGet mailing logClone mailingDelete mailingGet mailing status
        Broadcast mailingsarrow
      • Get broadcasts listGet broadcast informationCreate broadcast mailingUpdate broadcast mailingLaunch a broadcast mailing
        Regular mailingsarrow
      • Get regular mailings listGet regular mailing informationCreate regular mailingUpdate regular mailingLaunch a regular mailing
        Trigger mailingsarrow
      • Get trigger mailings listGet trigger mailing informationCreate trigger mailingUpdate trigger mailingTrigger launch (API call)Profile import + trigger mailing launchTask for bulk trigger launchTask for bulk profiles import + trigger launchBulk trigger launchBulk profiles import + trigger mailing launchClone a trigger mailingData array
      Automation scenariosarrow
    • Engage profile in scenarioImport and engage profile in scenarioBatch import and engage profiles in a scenarioTask for batch import and engaging profiles in the scenarioGet scenarios listActivate scenarioDeactivate scenario
      Loyalty Programsarrow
    • Get profile tier in a loyalty programExport points transactionsExpiring points for a periodGet profile account transactionsGet trigger promotions listAccrue points to a memberRedeem member pointsCommit temporary transactionPreliminary Order CalculationOrder ConfirmationRoll back temporary transactionCancel points transactionGet points account balanceRegister member in a loyalty programBatch adding participants to loyalty programTask for batch add participants to loyalty programRemove member from loyalty program
      Formsarrow
    • Get form informationGet form listExport form fill data by userExport form fill dataPublish formUnpublish formDelete form
      Promo codesarrow
    • Import promo codesGet promo code informationActivate promo codeUpdate promo codeAttach promo codeDetach promo codeGet all promo codes
      Goalsarrow
    • Goals and goal values registration
      Application push notificationsarrow
    • Processing and adding a subscriptionAdd app push events
      Marketarrow
      • Market objectsarrow
      • Order data objectProduct data objectSKU data objectCategories arrayCustom fields array
        Ordersarrow
      • Import order and item statusesGet orders listDelete orderGet order statusUpdate order line status
        Products and SKUarrow
      • Import products, SKUs and categoriesImport SKUs and categoriesGet products listGet SKUs listDelete productsDelete SKU
      Analytic reportsarrow
    • Get summary reportGet soft bounces reportGet undeliveries report
      Sendersarrow
    • Get senders list
        Virtual senders (Smart accounts only)arrow
      • Get virtual senders listGet virtual sender informationClone virtual senderCreate virtual senderUpdate virtual senderDelete virtual sender
      External datatables queriesarrow
      • Segmentation queriesarrow
      • Add segmentation queryUpdate segmentation queryGet segmentation query informationGet segmentation queries listDelete segmentation query
        Template queriesarrow
      • Add template queryUpdate template queryGet template query informationGet template queries listDelete template query
      Objectsarrow
    • AKMTA objectContent objectEmail rule objectFile objectProfile data objectSMS rule objectSender objectSender typesStart schedule objectSubscription objectTrigger types
      Miscellaneousarrow
    • Upload fileGet message web versionPush providersDeduplication of requestsHow to send API request with RabbitMQList of gender identificationsObtain valid values for fields: browsers, devices, tz, oses, languages
    Importing the API collection in PostmanList of API endpoints
      SDKarrow
      • mSDKarrow
        • Androidarrow
        • Quick StartSDK FunctionalitySDK ConfigurationPublic SDK API
            Provider configuration androidarrow
          • Firebase Cloud MessagingHuawei Mobile ServicesRuStore
          iOSarrow
        • Quick StartSDK FunctionalitySDK ConfigurationPublic SDK API
            Provider configurationarrow
          • Apple Push Notification ServiceFirebase Cloud MessagingHuawei Mobile Services
          React Native (Android/iOS)arrow
        • Quick StartSDK ConfigurationSDK FunctionalityPublic SDK APIProvider setup
          Flutter (Android/iOS)arrow
        • Quick StartSDK ConfigurationSDK FunctionalitySDK Public APIProvider Setup
        Managing JWT and Role Token
      Web Push SDK
  • SDK
  • mSDK
  • Flutter (Android/iOS)
  • SDK Configuration

SDK Configuration

Prerequisites​

  • The altcraft_sdk package is added to the Flutter project.
  • Push notification provider SDKs are integrated into the application project.
  • For Android, one or more providers are configured: FCM, HMS, RuStore.
  • For iOS, one or more providers are configured: APNS, FCM, HMS.
  • If API requests must be authorized via JWT, the JWT provider is registered on the native side of the application.
flutter pub add altcraft_sdk
flutter pub get

Application Preparation​

Passing JWT Token to the SDK (Optional)​

JWT implementation is required if JWT authentication of API requests is used. JWT confirms that user identifiers are authenticated by the application.

JWT authentication implementation is mandatory if a matching type other than push data from the subscription is used, such as email, phone, or internal user identifier.

In Flutter SDK, the JWT provider is not registered via the Dart API. It must be configured natively:

  • Android: in Application.onCreate;
  • iOS: in AppDelegate.

Setup is performed similarly to the native platform SDKs: Android and iOS.


Preparing for Push Providers​

Push provider setup is performed on the native side of the application.

Android:

  • Connecting FCM
  • Connecting HMS
  • Connecting RuStore
  • Passing push notifications to the SDK

iOS:

  • Connecting APNS
  • Connecting FCM
  • Connecting HMS
  • Setting up AppDelegate
  • Preparing NSE
Important

The Flutter package provides the Dart API and platform bridge. JWT registration, push provider registration, APNS/FCM/HMS/RuStore processing, and Notification Service Extension setup are performed in the native parts of the project.


SDK Initialization​

Initialization Parameters​

To pass configuration parameters, use the AltcraftConfig object:

const AltcraftConfig(
apiUrl: 'https://pxl-example.altcraft.com',
appInfo: AppInfo(
appID: '1:000000000000:android:0000000000000000',
appIID: '00000000-0000-4000-8000-000000000000',
appVer: '1.0.0',
),
providerPriorityList: ['android-firebase'],
)

Parameter description:

apiUrl String
Required: Yes
Description: Altcraft API endpoint URL.


appInfo AppInfo?
Default: null
Required: No
Description: Basic application metadata.

AppInfo fields:

FieldTypeDescription
appIDStringApplication identifier.
appIIDStringApplication installation identifier.
appVerStringApplication version.

providerPriorityList List<String>?
Default: null
Required: No
Description: Push provider priority list. Index 0 is the highest priority provider.

Example for Android:

providerPriorityList: ['android-firebase', 'android-huawei', 'android-rustore']

Example for iOS:

providerPriorityList: ['ios-apns', 'ios-firebase', 'ios-huawei']

Performing Initialization​

To initialize the SDK, use the initialize(config) function:

import 'package:altcraft_sdk/altcraft_sdk.dart';
import 'package:flutter/widgets.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await AltcraftSDK.initialize(
const AltcraftConfig(
apiUrl: 'https://pxl-example.altcraft.com',
appInfo: AppInfo(
appID: '1:000000000000:ios:0000000000000000',
appIID: '00000000-0000-4000-8000-000000000001',
appVer: '1.0.0',
),
providerPriorityList: ['ios-apns'],
),
);

runApp(const AppRoot());
}

class AppRoot extends StatelessWidget {
const AppRoot({super.key});

@override
Widget build(BuildContext context) {
return const Directionality(
textDirection: TextDirection.ltr,
child: SizedBox.shrink(),
);
}
}

Working with App Group and UserDefaults on iOS​

For iOS, the SDK provides methods for setting the App Group and writing values to UserDefaults.

import 'dart:io';

import 'package:altcraft_sdk/altcraft_sdk.dart';

void configureIosAppGroup() {
if (!Platform.isIOS) return;

const String appGroup = 'group.altcraft.flutter.example';

AltcraftSDK.setAppGroup(appGroup);
AltcraftSDK.setUserDefaultsValue(
appGroup,
'altcraft_jwt',
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtYXRjaGluZyI6ImVtYWlsIn0.signature',
);
}

The setUserDefaultsValue() method is also available on Android, where the value is saved to SharedPreferences.


Requesting Notification Permission​

For Android, use requestNotificationPermission():

import 'package:altcraft_sdk/altcraft_sdk.dart';

Future<bool> requestAndroidNotificationPermission() {
return AltcraftSDK.requestNotificationPermission();
}

The method returns true if permission is granted, and false if the user denied it.

Last updated on Jul 6, 2026
Previous
Quick Start
Next
SDK Functionality
  • Prerequisites
  • Application Preparation
    • Passing JWT Token to the SDK (Optional)
    • Preparing for Push Providers
  • SDK Initialization
    • Initialization Parameters
    • Performing Initialization
  • Working with App Group and UserDefaults on iOS
  • Requesting Notification Permission
© 2015 - 2026 Altcraft, LLC. All rights reserved.