Clone
1
Service-Plugin-Development
Jonathan Miller edited this page 2026-05-29 03:34:07 +00:00

Service Plugin Development

Interface Contract

Every service plugin must implement MokoJoomCrossServiceInterface:

  • getServiceType(): string — unique ID (e.g. 'discord')
  • getServiceName(): string — display name
  • publish(message, media, credentials, params): array — post to platform
  • validateCredentials(credentials): array — test stored credentials
  • getMaxLength(): int — char limit (0 = unlimited)
  • supportsMedia(): bool — whether platform accepts images

Plugin Structure

plg_mokojoomcross_myservice/
  myservice.xml          # Manifest (group=mokojoomcross)
  myservice.php          # Legacy stub
  services/provider.php  # DI registration
  src/Extension/MyserviceService.php
  language/en-GB/

Registration

Plugins subscribe to onMokoJoomCrossGetServices and add themselves to the services array.

publish() Return Format

{success: bool, platform_post_id: string, response: array}