Basic Configuration
MarsApp frontend supports mainstream frameworks such as React and Vue, ensuring a good experience across various mobile devices. During development, if communication with RelayX is required, refer to the API interface descriptions.
Each MarsApp should have a unique icon named icon.png, with a recommended size of 192x192 pixels. After packaging, this icon should be placed in the project root directory to ensure the MarsApp icon displays correctly. The icon.png naming cannot be changed arbitrarily; if it is missing or named incorrectly, an exception will be prompted when publishing MarsApp.
Development must follow these project specifications:
File Size
Ensure each packaged file (including resource files) is smaller than 4MB, and the entire ZIP package size does not exceed 10MB, to avoid affecting MarsApp's publishing and updating capabilities. RelayX Network will continue to expand network performance to support larger MarsApps in the future.
window.parent.postMessage({
type: 'my-app-message',
data: { /* your business data */ },
noRelayAPI: true // Must add this field
}, '*');{
"code": 200,
"cmd": "xxxx",
"messageId": "0",
"result": {}
}window.addEventListener('message', (event) => {
const message = event.data;
// Filter out RelayApp API messages
if (message && typeof message === 'object' &&
('code' in message && 'cmd' in message && 'messageId' in message)) {
return; // This is a RelayApp API return message, ignore processing
}
// Handle custom application messages
if (message.type === 'my-app-message') {
// Process your application message
}
});Last updated