Update: 2026-07-23 21:02:51

This commit is contained in:
Hamza-Ayed
2026-07-23 21:02:51 +03:00
parent b4451a0dde
commit 7d646b579b
4 changed files with 26 additions and 7 deletions
+14 -3
View File
@@ -17,8 +17,12 @@ class FcmService
$this->serviceAccountFile = $envPath;
} elseif (file_exists('/keys/firebase_service_account.json')) {
$this->serviceAccountFile = '/keys/firebase_service_account.json';
} else {
} elseif (file_exists(__DIR__ . '/../../keys/firebase_service_account.json')) {
$this->serviceAccountFile = __DIR__ . '/../../keys/firebase_service_account.json';
} elseif (file_exists(__DIR__ . '/../../ride/firebase/service-account.json')) {
$this->serviceAccountFile = __DIR__ . '/../../ride/firebase/service-account.json';
} else {
$this->serviceAccountFile = __DIR__ . '/../../keys/firebase_service_account.json'; // Default fallback
}
}
@@ -64,7 +68,13 @@ class FcmService
'message' => [
'token' => $token,
'data' => $processedData,
'android' => ['priority' => 'HIGH'],
'android' => [
'priority' => 'HIGH',
'notification' => [
'sound' => $tone === 'ding' ? 'default' : $tone,
'channel_id' => 'high_importance_channel'
]
],
],
];
@@ -73,10 +83,11 @@ class FcmService
'title' => $title,
'body' => $body,
];
$iosSound = $tone === 'ding' || $tone === 'default' ? 'default' : (str_ends_with($tone, '.caf') ? $tone : $tone . '.caf');
$payload['message']['apns'] = [
'payload' => [
'aps' => [
'sound' => $tone === 'ding' ? 'default' : $tone
'sound' => $iosSound
]
]
];
+1 -1
View File
@@ -101,7 +101,7 @@ class AppLink {
}
}
static String loginJwtDriver = "https://api.intaleq.xyz/siro/loginAdmin.php";
static String loginJwtDriver = "$server/loginAdmin.php";
//=============================
//=============================
static final getAllFingerprints =
@@ -100,7 +100,10 @@ class CRUD {
);
Log.print('Status Code: ${response.statusCode}');
Log.print('Response Body: ${response.body}');
String preview = response.body.length > 500
? '${response.body.substring(0, 500)}... (truncated)'
: response.body;
Log.print('Response Body: $preview');
Log.print('------------------');
if (response.statusCode == 200) {
@@ -157,7 +160,10 @@ class CRUD {
);
Log.print('Status Code: ${response.statusCode}');
Log.print('Response Body: ${response.body}');
String preview = response.body.length > 500
? '${response.body.substring(0, 500)}... (truncated)'
: response.body;
Log.print('Response Body: $preview');
Log.print('-------------------');
if (response.statusCode == 200) {
@@ -4,6 +4,8 @@ import 'package:get_storage/get_storage.dart'; // Ensure get_storage is in pubsp
import 'package:siro_admin/controller/functions/wallet.dart';
import 'package:siro_admin/views/widgets/snackbar.dart';
import 'package:siro_admin/constant/links.dart';
// --- New Controller to handle the specific JSON URL ---
class DriverCacheController extends GetxController {
List<dynamic> drivers = [];
@@ -32,7 +34,7 @@ class DriverCacheController extends GetxController {
try {
// Using GetConnect to fetch the JSON directly
final response = await GetConnect().get(
'https://api.intaleq.xyz/siro/ride/location/active_drivers_cache.json',
'${AppLink.server}/ride/location/active_drivers_cache.json',
);
if (response.body != null && response.body is Map) {