mSDK v2
Description
Altcraft mSDK v2.0 is an updated mobile SDK that ensures reliable push notification handling and seamless interaction with the Altcraft platform. It is designed for Android and iOS, supports Firebase, Huawei, RuStore, and APNS, and provides extended functionality for managing subscriptions, processing events, and working with multiple users on a single device.
The SDK supports JWT tokens and rTokens, offering flexible security levels and profile data matching types. Automatic notification and delivery event handling ensures stability and high data accuracy, while the built-in WorkManager guarantees event delivery even during network failures.
Altcraft mSDK v2 is available on GitHub for iOS and Android.
Features
- Push notification subscription management: add, pause, unsubscribe.
 - Automatic display of notifications with content configured in the platform, with customizable presentation options.
 - Automatic push token refresh upon change.
 - Automatic tracking of notification delivery and open events.
 - Mobile events registration.
 - Support for anonymous and registered users, as well as multiple users on one device (when using JWT).
 - Automatic request retries via WorkManager for maximum event delivery reliability.
 - Support for push providers: Firebase, Huawei, RuStore (Android), APNS (iOS).
 - Use of JWT tokens for enhanced security and unlimited profile matching options.
 - Option to work via rToken with restricted access by push subscription ID.
 - Support for custom push notification formatting and access to all message data fields.
 
Authorization types
JWT token
This authorization type uses a JWT token provided by the application to the SDK. The token is added to the header of each request.
JWT (JSON Web Token) is a JSON-formatted string containing claims (a set of data) signed to verify authenticity and integrity.
The token is generated and signed using an encryption key on the client’s backend (encryption keys are not stored in the app). Upon SDK request, the app must provide the JWT token obtained from the server.
Advantages:
- Enhanced security of API requests.
 - Ability to find profiles by any identifier (email, phone, custom ID).
 - Support for multiple users on a single device.
 - Profile recovery after app reinstallation.
 - Profile identification across multiple devices.
 
rToken
An alternative authorization method is the use of a role-based token (rToken), passed in the SDK configuration parameters. With this method, requests include a header containing the role token.
Features:
- Profile search is possible only by the device’s push token (e.g., FCM).
 - If the push token changes and is not sent to the server (for example, after app deletion and reinstallation), the link to the profile will be lost/a new profile will be created.
 
Limitations:
- Loss of profile linkage if the push token change is not recorded on the Altcraft server.
 - Inability to use the app for multiple profiles on one device.
 - Inability to register one user on another device.