Add mobile app infrastructure and Gitea auto-update support
This commit adds comprehensive mobile app support to enable a native Android app that won't timeout or sleep when the screen goes dark.
New Features:
- JWT-based authentication system (no WordPress session dependency)
- REST API endpoints for mobile app (agent status, queue management, call control)
- Server-Sent Events (SSE) for real-time updates to mobile app
- Firebase Cloud Messaging (FCM) integration for push notifications
- Gitea-based automatic plugin updates
- Mobile app admin settings page
New Files:
- includes/class-twp-mobile-auth.php - JWT authentication with login/refresh/logout
- includes/class-twp-mobile-api.php - REST API endpoints under /twilio-mobile/v1
- includes/class-twp-mobile-sse.php - Real-time event streaming
- includes/class-twp-fcm.php - Push notification handling
- includes/class-twp-auto-updater.php - Gitea-based auto-updates
- admin/mobile-app-settings.php - Admin configuration page
Modified Files:
- includes/class-twp-activator.php - Added twp_mobile_sessions table
- includes/class-twp-core.php - Load and initialize mobile classes
- admin/class-twp-admin.php - Added Mobile App menu item and settings page
Database Changes:
- New table: twp_mobile_sessions (stores JWT refresh tokens and FCM tokens)
API Endpoints:
- POST /twilio-mobile/v1/auth/login
- POST /twilio-mobile/v1/auth/refresh
- POST /twilio-mobile/v1/auth/logout
- GET/POST /twilio-mobile/v1/agent/status
- GET /twilio-mobile/v1/queues/state
- POST /twilio-mobile/v1/calls/{call_sid}/accept
- GET /twilio-mobile/v1/stream/events (SSE)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -119,7 +119,16 @@ class TWP_Admin {
|
||||
'twilio-wp-settings',
|
||||
array($this, 'display_plugin_settings')
|
||||
);
|
||||
|
||||
|
||||
add_submenu_page(
|
||||
'twilio-wp-plugin',
|
||||
'Mobile App',
|
||||
'Mobile App',
|
||||
'manage_options',
|
||||
'twilio-wp-mobile-app',
|
||||
array($this, 'display_mobile_app_settings')
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'twilio-wp-plugin',
|
||||
'Phone Schedules',
|
||||
@@ -10049,5 +10058,12 @@ class TWP_Admin {
|
||||
wp_send_json_error('Failed to accept transfer: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display mobile app settings page
|
||||
*/
|
||||
public function display_mobile_app_settings() {
|
||||
require_once TWP_PLUGIN_DIR . 'admin/mobile-app-settings.php';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user