appRequest (22)

The appRequest message is sent to invite another peer to start a Mini-App session. It identifies which app to launch and provides initial data for the session setup.

This is the first message in the Mini-App lifecycle. The recipient can respond with appRequestAccept, appRequestReject, or appRequestError.

Core Data Types

Payload Structure

The payload is an AppDataMessage object with app identification information.

FieldData TypeMinMaxDescription
sessionIdIxiBytes**A unique identifier for this session, generated by the requester. Used to track all subsequent messages in this session.
dataIxiBytes0*Optional. Application-specific initialization data (e.g., game parameters, room ID, initial state).
appIdstring1*The unique identifier of the Mini-App to launch (e.g., com.company.appname). Used by the recipient to determine which app should handle this session.

Behavioral Notes

  • Trigger: This message is sent when a user initiates a Mini-App session with a contact (e.g., starting a game, sharing a document).
  • Session Creation: The sessionId must be unique and is used for all subsequent messages in this session (appData, appEndSession, etc.).
  • Response Flow: The recipient should respond with one of:
    • appRequestAccept - User accepts and the session becomes active
    • appRequestReject - User declines the invitation
    • appRequestError - Technical issue prevents session start (app not installed, invalid data, etc.)
  • App Identification: The appId field allows the recipient to launch the correct Mini-App. If the app is not installed, the recipient should send appRequestError.