Add FCM push notifications, queue alerts, caller ID fixes, and auto-revert agent status
All checks were successful
Create Release / build (push) Successful in 6s
All checks were successful
Create Release / build (push) Successful in 6s
Server-side: - Add push credential auto-creation for FCM incoming call notifications - Add queue alert FCM notifications (data-only for background delivery) - Add queue alert cancellation on call accept/disconnect - Fix caller ID to show caller's number instead of Twilio number - Fix FCM token storage when refresh_token is null - Add pre_call_status tracking to revert agent status 30s after call ends - Add SSE fallback polling for mobile app connectivity Mobile app: - Add Android telecom permissions and phone account registration - Add VoiceFirebaseMessagingService for incoming call push handling - Add insistent queue alert notifications with custom sound - Fix caller number display on active call screen - Add caller ID selection dropdown on dashboard - Add phone numbers endpoint and provider support - Add unit tests for CallInfo, QueueState, and CallProvider - Remove local.properties from tracking, add .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -423,13 +423,21 @@ class TWP_Mobile_Auth {
|
||||
global $wpdb;
|
||||
$table = $wpdb->prefix . 'twp_mobile_sessions';
|
||||
|
||||
$wpdb->update(
|
||||
$table,
|
||||
array('fcm_token' => $fcm_token),
|
||||
array('user_id' => $user_id, 'refresh_token' => $refresh_token, 'is_active' => 1),
|
||||
array('%s'),
|
||||
array('%d', '%s', '%d')
|
||||
);
|
||||
if (!empty($refresh_token)) {
|
||||
$wpdb->update(
|
||||
$table,
|
||||
array('fcm_token' => $fcm_token),
|
||||
array('user_id' => $user_id, 'refresh_token' => $refresh_token, 'is_active' => 1),
|
||||
array('%s'),
|
||||
array('%d', '%s', '%d')
|
||||
);
|
||||
} else {
|
||||
// No refresh token — update the most recent active session for this user
|
||||
$wpdb->query($wpdb->prepare(
|
||||
"UPDATE $table SET fcm_token = %s WHERE user_id = %d AND is_active = 1 AND expires_at > NOW() ORDER BY created_at DESC LIMIT 1",
|
||||
$fcm_token, $user_id
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user