Update: 2026-07-23 21:02:51
This commit is contained in:
@@ -17,8 +17,12 @@ class FcmService
|
|||||||
$this->serviceAccountFile = $envPath;
|
$this->serviceAccountFile = $envPath;
|
||||||
} elseif (file_exists('/keys/firebase_service_account.json')) {
|
} elseif (file_exists('/keys/firebase_service_account.json')) {
|
||||||
$this->serviceAccountFile = '/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';
|
$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' => [
|
'message' => [
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'data' => $processedData,
|
'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,
|
'title' => $title,
|
||||||
'body' => $body,
|
'body' => $body,
|
||||||
];
|
];
|
||||||
|
$iosSound = $tone === 'ding' || $tone === 'default' ? 'default' : (str_ends_with($tone, '.caf') ? $tone : $tone . '.caf');
|
||||||
$payload['message']['apns'] = [
|
$payload['message']['apns'] = [
|
||||||
'payload' => [
|
'payload' => [
|
||||||
'aps' => [
|
'aps' => [
|
||||||
'sound' => $tone === 'ding' ? 'default' : $tone
|
'sound' => $iosSound
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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 =
|
static final getAllFingerprints =
|
||||||
|
|||||||
@@ -100,7 +100,10 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Log.print('Status Code: ${response.statusCode}');
|
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('------------------');
|
Log.print('------------------');
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@@ -157,7 +160,10 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Log.print('Status Code: ${response.statusCode}');
|
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('-------------------');
|
Log.print('-------------------');
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
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/controller/functions/wallet.dart';
|
||||||
import 'package:siro_admin/views/widgets/snackbar.dart';
|
import 'package:siro_admin/views/widgets/snackbar.dart';
|
||||||
|
|
||||||
|
import 'package:siro_admin/constant/links.dart';
|
||||||
|
|
||||||
// --- New Controller to handle the specific JSON URL ---
|
// --- New Controller to handle the specific JSON URL ---
|
||||||
class DriverCacheController extends GetxController {
|
class DriverCacheController extends GetxController {
|
||||||
List<dynamic> drivers = [];
|
List<dynamic> drivers = [];
|
||||||
@@ -32,7 +34,7 @@ class DriverCacheController extends GetxController {
|
|||||||
try {
|
try {
|
||||||
// Using GetConnect to fetch the JSON directly
|
// Using GetConnect to fetch the JSON directly
|
||||||
final response = await GetConnect().get(
|
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) {
|
if (response.body != null && response.body is Map) {
|
||||||
|
|||||||
Reference in New Issue
Block a user