diff --git a/backend/Admin/adminUser/add_invoice.php b/backend/Admin/adminUser/add_invoice.php index 72469ce..ae9b84d 100755 --- a/backend/Admin/adminUser/add_invoice.php +++ b/backend/Admin/adminUser/add_invoice.php @@ -59,7 +59,9 @@ if (isset($_FILES['image']) && $_FILES['image']['error'] === UPLOAD_ERR_OK) { exit; } - $linkImage = 'https://intaleq.xyz/siro/Admin/adminUser/invoice_images/' . $new_filename; + $host = $_SERVER['HTTP_HOST'] ?? 'api.siromove.com'; + $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; + $linkImage = "$protocol://$host/siro/Admin/adminUser/invoice_images/" . $new_filename; error_log("[add_invoice.php] ✅ Image uploaded successfully: $linkImage"); } diff --git a/backend/EgyptDocuments/uploadEgyptIdBack.php b/backend/EgyptDocuments/uploadEgyptIdBack.php index 96ccfbb..50fe46c 100644 --- a/backend/EgyptDocuments/uploadEgyptIdBack.php +++ b/backend/EgyptDocuments/uploadEgyptIdBack.php @@ -1,31 +1,48 @@ $_FILES['image']['name'] ?? 'unknown', + 'type' => $_FILES['image']['type'] ?? 'unknown', + 'size' => $_FILES['image']['size'] ?? 0, + 'upload_error_code' => $_FILES['image']['error'] ?? UPLOAD_ERR_OK + ]); +} else { + uploadLog("No 'image' file was sent in the request.", 'WARNING'); +} + +if (!isset($_FILES['image']) || $_FILES['image']['error'] !== UPLOAD_ERR_OK) { + $err = $_FILES['image']['error'] ?? 'missing_file'; + uploadLog("❌ File upload validation failed. Code: $err", 'ERROR'); + jsonError("Image upload failed"); + exit; +} + +$image_file = $_FILES['image']; +$allowed_extensions = ['jpg', 'jpeg', 'png']; + // Get file information $image_name = $image_file['name']; $image_size = $image_file['size']; $image_extension = strtolower(pathinfo($image_name, PATHINFO_EXTENSION)); // Validate file extension -if (!in_array($image_extension, $allowed_extensions)) { - echo "Invalid image format"; - exit; +if (!in_array($image_extension, $allowed_extensions, true)) { + uploadLog("❌ Invalid image format extension: .$image_extension", 'ERROR'); + jsonError("Invalid image format"); + exit; } // Validate MIME type @@ -34,38 +51,42 @@ $mime_type = finfo_file($finfo, $image_file['tmp_name']); finfo_close($finfo); $allowed_mime_types = ['image/jpeg', 'image/png', 'image/jpg']; -if (!in_array($mime_type, $allowed_mime_types)) { - echo "Invalid image format (MIME mismatch)"; - exit; +if (!in_array($mime_type, $allowed_mime_types, true)) { + uploadLog("❌ Invalid MIME type: $mime_type", 'ERROR'); + jsonError("Invalid image format (MIME mismatch)"); + exit; } -// Generate a unique filename using timestamp and random string +// Generate a unique filename using driverID $new_filename = $driverID . '.' . $image_extension; // Set target directory for uploads -$target_dir = "card_image/"; +$target_dir = __DIR__ . "/card_image/"; +if (!is_dir($target_dir)) { + mkdir($target_dir, 0755, true); +} // Construct target file path $target_file = $target_dir . $new_filename; // Move the image file to the target location if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { - echo json_encode(array('status' => "Failed to save image")); ; - exit; + uploadLog("❌ Failed to save image to target file: $target_file", 'ERROR'); + jsonError("Failed to save image"); + exit; } -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; +// Resolve dynamic URL +$host = $_SERVER['HTTP_HOST'] ?? 'api.siromove.com'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +$image_url = "$protocol://$host/siro/EgyptDocuments/card_image/" . $new_filename; -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); +uploadLog("✅ Egypt ID back uploaded successfully. URL: $image_url"); +printSuccess([ + "status" => "success", + "url" => $image_url, + "file_link" => $image_url, + "image_url" => $image_url +]); ?> diff --git a/backend/EgyptDocuments/uploadEgyptidFront.php b/backend/EgyptDocuments/uploadEgyptidFront.php index 357805c..03703ff 100644 --- a/backend/EgyptDocuments/uploadEgyptidFront.php +++ b/backend/EgyptDocuments/uploadEgyptidFront.php @@ -1,31 +1,48 @@ $_FILES['image']['name'] ?? 'unknown', + 'type' => $_FILES['image']['type'] ?? 'unknown', + 'size' => $_FILES['image']['size'] ?? 0, + 'upload_error_code' => $_FILES['image']['error'] ?? UPLOAD_ERR_OK + ]); +} else { + uploadLog("No 'image' file was sent in the request.", 'WARNING'); +} + +if (!isset($_FILES['image']) || $_FILES['image']['error'] !== UPLOAD_ERR_OK) { + $err = $_FILES['image']['error'] ?? 'missing_file'; + uploadLog("❌ File upload validation failed. Code: $err", 'ERROR'); + jsonError("Image upload failed"); + exit; +} + +$image_file = $_FILES['image']; +$allowed_extensions = ['jpg', 'jpeg', 'png']; + // Get file information $image_name = $image_file['name']; $image_size = $image_file['size']; $image_extension = strtolower(pathinfo($image_name, PATHINFO_EXTENSION)); // Validate file extension -if (!in_array($image_extension, $allowed_extensions)) { - echo "Invalid image format"; - exit; +if (!in_array($image_extension, $allowed_extensions, true)) { + uploadLog("❌ Invalid image format extension: .$image_extension", 'ERROR'); + jsonError("Invalid image format"); + exit; } // Validate MIME type @@ -34,38 +51,42 @@ $mime_type = finfo_file($finfo, $image_file['tmp_name']); finfo_close($finfo); $allowed_mime_types = ['image/jpeg', 'image/png', 'image/jpg']; -if (!in_array($mime_type, $allowed_mime_types)) { - echo "Invalid image format (MIME mismatch)"; - exit; +if (!in_array($mime_type, $allowed_mime_types, true)) { + uploadLog("❌ Invalid MIME type: $mime_type", 'ERROR'); + jsonError("Invalid image format (MIME mismatch)"); + exit; } -// Generate a unique filename using timestamp and random string +// Generate a unique filename using driverID $new_filename = $driverID . '.' . $image_extension; // Set target directory for uploads -$target_dir = "egypt/idFront/"; +$target_dir = __DIR__ . "/egypt/idFront/"; +if (!is_dir($target_dir)) { + mkdir($target_dir, 0755, true); +} // Construct target file path $target_file = $target_dir . $new_filename; // Move the image file to the target location if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { - echo json_encode(array('status' => "Failed to save image")); ; - exit; + uploadLog("❌ Failed to save image to target file: $target_file", 'ERROR'); + jsonError("Failed to save image"); + exit; } -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; +// Resolve dynamic URL +$host = $_SERVER['HTTP_HOST'] ?? 'api.siromove.com'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +$image_url = "$protocol://$host/siro/EgyptDocuments/egypt/idFront/" . $new_filename; -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); +uploadLog("✅ Egypt ID front uploaded successfully. URL: $image_url"); +printSuccess([ + "status" => "success", + "url" => $image_url, + "file_link" => $image_url, + "image_url" => $image_url +]); ?> diff --git a/backend/auth/document_syria/ai_document.php b/backend/auth/document_syria/ai_document.php index e050cf7..d942777 100755 --- a/backend/auth/document_syria/ai_document.php +++ b/backend/auth/document_syria/ai_document.php @@ -46,7 +46,9 @@ if (!move_uploaded_file($file['tmp_name'], $uploadPath)) { exit; } -$imageUrl = "https://intaleq.xyz/siro/auth/uploads/documents/" . $uniqueName ; +$host = $_SERVER['HTTP_HOST'] ?? 'api-syria.siromove.com'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +$imageUrl = "$protocol://$host/siro/auth/uploads/documents/" . $uniqueName ; $imageData = file_get_contents($uploadPath); $imageBase64 = base64_encode($imageData); @@ -196,7 +198,7 @@ EOT $prompt = $prompts[$type] ?? $prompts["id_front_sy"]; $apiKey = getenv("GEMINI_API_KEY"); -$apiURL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-lite:generateContent?key=$apiKey"; +$apiURL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-lite-latest:generateContent?key=$apiKey"; $headers = ["Content-Type: application/json"]; $payload = [ diff --git a/backend/auth/document_syria/uploadDocSyria.php b/backend/auth/document_syria/uploadDocSyria.php index 7cc0aba..d5e26e9 100755 --- a/backend/auth/document_syria/uploadDocSyria.php +++ b/backend/auth/document_syria/uploadDocSyria.php @@ -6,6 +6,8 @@ require_once __DIR__ . '/../../connect.php'; +uploadLog("🚀 [uploadDocSyria.php] Document upload script started."); + $driverId = trim((string) filterRequest("driver_id")); $type = trim((string) filterRequest("type")); @@ -13,8 +15,23 @@ $type = trim((string) filterRequest("type")); if ($driverId === "") { $driverId = "unknown"; } if ($type === "") { $type = "generic"; } +uploadLog("📥 Request parameters: driver_id=$driverId, type=$type"); + // ✅ التحقق من ملف الصورة +if (isset($_FILES['image'])) { + uploadLog("$_FILES['image'] metadata", 'INFO', [ + 'name' => $_FILES['image']['name'] ?? 'unknown', + 'type' => $_FILES['image']['type'] ?? 'unknown', + 'size' => $_FILES['image']['size'] ?? 0, + 'upload_error_code' => $_FILES['image']['error'] ?? UPLOAD_ERR_OK + ]); +} else { + uploadLog("No 'image' file was sent in the request.", 'WARNING'); +} + if (!isset($_FILES['image']) || $_FILES['image']['error'] !== UPLOAD_ERR_OK) { + $err = $_FILES['image']['error'] ?? 'missing_file'; + uploadLog("❌ File upload validation failed. Code: $err", 'ERROR'); error_log("Upload error: Image not provided or upload failed."); jsonError("Image upload failed"); exit; @@ -26,6 +43,7 @@ $file = $_FILES['image']; $allowedExt = ['jpg', 'jpeg', 'png']; $extension = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)); if (!in_array($extension, $allowedExt, true)) { + uploadLog("❌ Unsupported file extension: $extension", 'ERROR'); error_log("Unsupported file extension: $extension"); jsonError("Unsupported file type"); exit; @@ -91,7 +109,7 @@ $publicPath = "/siro/auth/uploads/documents/" . $uniqueName; $imageUrl = rtrim(BASE_URL, '/') . $publicPath; // ✅ نتيجة نهائية: فقط رابط الصورة وبعض البيانات المفيدة +uploadLog("✅ Document upload succeeded. URL: $imageUrl"); printSuccess([ $imageUrl, - ]); \ No newline at end of file diff --git a/backend/auth/syria/driver/register_driver_and_car.php b/backend/auth/syria/driver/register_driver_and_car.php index 2c2ad71..d56c83b 100755 --- a/backend/auth/syria/driver/register_driver_and_car.php +++ b/backend/auth/syria/driver/register_driver_and_car.php @@ -16,8 +16,9 @@ try { exit; } - /* ================== General Settings ================== */ - $PUBLIC_BASE = "https://intaleq.xyz/driver_docs"; + $host = $_SERVER['HTTP_HOST'] ?? 'api-syria.siromove.com'; + $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; + $PUBLIC_BASE = "$protocol://$host/siro/auth/uploads/documents"; /* ================== 1) Input Fields ================== */ $raw_first_name = null; @@ -38,8 +39,12 @@ try { // vehicle_category_id, fuel_type_id $docKeys = [ - 'driver_license_front', + 'id_front', + 'id_back', + 'driver_license', 'driver_license_back', + 'profile_picture', + 'criminal_record', 'car_license_front', 'car_license_back' ]; @@ -63,6 +68,7 @@ try { } /* ================== 🟢 START PHONE FORMATTING LOGIC 🟢 ================== */ + $country = 'Syria'; // Default if (!empty($data['phone'])) { $phone = $data['phone']; @@ -70,39 +76,46 @@ try { $phone = preg_replace('/[ \-\(\)\+]/', '', $phone); $phone = trim($phone); - // 2. توحيد البادئات الدولية - if (strpos($phone, '00963') === 0) { - $phone = substr($phone, 2); - } elseif (strpos($phone, '0963') === 0) { - $phone = substr($phone, 1); - } + if (strpos($phone, '962') === 0 || strpos($phone, '00962') === 0) { + if (strpos($phone, '00962') === 0) $phone = substr($phone, 2); + $country = 'Jordan'; + } elseif (strpos($phone, '20') === 0 || strpos($phone, '0020') === 0) { + if (strpos($phone, '0020') === 0) $phone = substr($phone, 2); + $country = 'Egypt'; + } else { + // 2. توحيد البادئات الدولية (سوريا) + if (strpos($phone, '00963') === 0) { + $phone = substr($phone, 2); + } elseif (strpos($phone, '0963') === 0) { + $phone = substr($phone, 1); + } - // 3. معالجة الحالات الخاصة بالصفر الزائد بعد الرمز الدولي - if (strpos($phone, '96309') === 0) { - $phone = '9639' . substr($phone, 5); - } - elseif (strpos($phone, '9630') === 0) { - $phone = '9639' . substr($phone, 4); - } + // 3. معالجة الحالات الخاصة بالصفر الزائد بعد الرمز الدولي + if (strpos($phone, '96309') === 0) { + $phone = '9639' . substr($phone, 5); + } + elseif (strpos($phone, '9630') === 0) { + $phone = '9639' . substr($phone, 4); + } - // 4. معالجة الأرقام المحلية - elseif (strpos($phone, '09') === 0) { - $phone = '963' . substr($phone, 1); - } - elseif (strpos($phone, '9') === 0 && strlen($phone) == 9) { - $phone = '963' . $phone; - } - elseif (strpos($phone, '0') === 0 && strlen($phone) == 10) { - $phone = '963' . substr($phone, 1); - } - - // 5. التأكد من وجود 9 بعد الرمز الدولي - if (strpos($phone, '963') === 0 && strlen($phone) > 3) { - if (strpos($phone, '9639') !== 0) { - $phone = '9639' . substr($phone, 3); + // 4. معالجة الأرقام المحلية + elseif (strpos($phone, '09') === 0) { + $phone = '963' . substr($phone, 1); + } + elseif (strpos($phone, '9') === 0 && strlen($phone) == 9) { + $phone = '963' . $phone; + } + elseif (strpos($phone, '0') === 0 && strlen($phone) == 10) { + $phone = '963' . substr($phone, 1); + } + + // 5. التأكد من وجود 9 بعد الرمز الدولي + if (strpos($phone, '963') === 0 && strlen($phone) > 3) { + if (strpos($phone, '9639') !== 0) { + $phone = '9639' . substr($phone, 3); + } } } - $data['phone'] = $phone; } /* ================== 🔴 END PHONE FORMATTING LOGIC 🔴 ================== */ @@ -131,6 +144,7 @@ try { $docUrls = []; foreach ($docKeys as $k) { $u = filterRequest($k); + if (($k === 'driver_license_back' || $k === 'criminal_record') && ($u === null || $u === '')) continue; if ($u === null || $u === '') { jsonError("Missing document URL: $k"); exit; @@ -142,6 +156,149 @@ try { $docUrls[$k] = $u; } + /* ================== AI PROCESSING START ================== */ + $apiKey = getenv("GEMINI_API_KEY"); + if ($apiKey) { + $promptBase = ' +You are a highly secure AI Assistant specialized in analyzing identification and driver documents. +Country Context: ' . ($country ?? 'Syria') . ' + +### TASK +We are providing you with multiple images representing a driver\'s documents (National ID, Driver License, Profile Picture, Criminal Record, and Car Registration). +Extract all the required data accurately according to the exact schema provided, and perform a FACE MATCHING analysis. +Since the driver may be from Jordan, Egypt, or Syria, the layout, fields, and distribution of information between the front and back of each card varies widely by country. +Therefore, do NOT assume a specific field is on the front or the back of a card. You must scan all provided document images (e.g., both ID images, both license images) and intelligently locate the requested fields wherever they appear on the cards. + +### RULES +1. Convert any Eastern-Arabic digits (٠١٢٣٤٥٦٧٨٩) to Western digits (0-9). +2. Dates must be formatted as ISO `YYYY-MM-DD`. +3. Smart Extraction: Scan all provided document images without restriction. Do not fail the overall request if some optional fields (like governorate or address or issue dates) are missing or unreadable on the card. Simply set those specific fields to `null` in the JSON, but do NOT set the overall status to failure. Overall status should only be \'failure\' if there is a critical security/authenticity issue (e.g., face mismatch, fake/forged documents, or missing primary driver identity). +4. FACE MATCHING (CRITICAL): Compare the face in the "Profile Picture" with the photos on the "National ID" and "Driver License". +5. Ensure the Criminal/Non-Conviction record is valid and matches the driver\'s name. +6. The `national_number` and `vin` (chassis) must contain Latin digits/characters only. +7. Normalize color names (e.g. "أبيض" -> "White") and provide a matching Hex code (e.g. "#FFFFFF"). +8. Do NOT add markdown formatting around the output. Return ONLY raw JSON. + +### REQUIRED JSON OUTPUT FORMAT +{ + "status": "success|failure", + "reason": "If failure, state the reason (e.g., Face mismatch, blurry, invalid record)", + "face_match_confidence": "high|low", + "driver": { + "full_name": "", // Full name in Arabic + "national_number": "", // National ID/National number (Latin digits) + "dob": "YYYY-MM-DD", // Date of birth + "address": "", // Full address + "governorate": "", // Governorate/Site/City + "gender": "Male|Female", // Gender + "id_issue_date": "YYYY-MM-DD", // National ID issue date + "license_issue_date": "YYYY-MM-DD", // Driver license issue date + "license_expiry_date": "YYYY-MM-DD", // Driver license expiry date + "license_number": "", // Driver license number + "license_category": "", // License category (e.g., D1, B, Private, Public) + "blood_type": "", // Blood type (e.g., A+, O-) + "civil_registry": "", // Civil registry/Place of registration + "birth_place": "" // Place of birth + }, + "car": { + "car_plate": "", // Full car plate (e.g., 155186 درعا) + "owner": "", // Owner full name + "vin": "", // Chassis/VIN number + "color": "", // Color name + "color_hex": "", // Color hex code (e.g., #FFFFFF) + "car_issue_date": "YYYY-MM-DD", // Car registration issue date + "inspection_date": "YYYY-MM-DD", // Car next inspection date + "make": "", // Car Make (e.g., Hyundai) + "model": "", // Car Model (e.g., H1) + "year": "", // Manufacturing year (e.g., 2019) + "fuel": "" // Fuel type (e.g., Petrol, Diesel, Electric) + } +}'; + + $contents = [ + ["role" => "user", "parts" => [["text" => $promptBase]]] + ]; + + foreach ($docUrls as $key => $url) { + $imgData = @file_get_contents($url); + if ($imgData !== false) { + $base64 = base64_encode($imgData); + $ext = strtolower(pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION)); + $mime = ($ext === 'png') ? 'image/png' : 'image/jpeg'; + $contents[0]["parts"][] = ["text" => "Image type: " . $key]; + $contents[0]["parts"][] = ["inlineData" => ["mimeType" => $mime, "data" => $base64]]; + } + } + + $apiURL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-lite-latest:generateContent?key=$apiKey"; + $payload = ["contents" => $contents]; + + $ch = curl_init($apiURL); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); + $response = curl_exec($ch); + curl_close($ch); + + if ($response) { + $aiData = json_decode($response, true); + $textRaw = $aiData['candidates'][0]['content']['parts'][0]['text'] ?? ''; + $textRaw = trim(preg_replace('/```json|```/', '', $textRaw)); + $json = json_decode($textRaw, true); + + if ($json && isset($json['status']) && strtolower($json['status']) === 'failure') { + jsonError("AI Verification Failed: " . ($json['reason'] ?? 'Unknown reason')); + exit; + } + + if ($json && isset($json['driver'])) { + $ex = $json['driver']; + if (!empty($ex['full_name'])) { + $data['name_arabic'] = $ex['full_name']; + $parts = explode(' ', trim($ex['full_name'])); + if (count($parts) >= 2) { + $data['first_name'] = $parts[0]; + $data['last_name'] = implode(' ', array_slice($parts, 1)); + } else { + $data['first_name'] = $ex['full_name']; + $data['last_name'] = ''; + } + } + if (!empty($ex['national_number'])) $data['national_number'] = $ex['national_number']; + if (!empty($ex['dob'])) { + if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $ex['dob'])) { + $data['birthdate'] = $ex['dob']; + } elseif (preg_match('/^\d{4}$/', $ex['dob'])) { + $data['birthdate'] = $ex['dob'] . '-01-01'; + } + } + if (!empty($ex['address'])) $data['address'] = $ex['address']; + if (!empty($ex['governorate'])) $data['site'] = $ex['governorate']; + if (!empty($ex['gender'])) $data['gender'] = $ex['gender']; + if (!empty($ex['id_issue_date'])) $data['issue_date'] = $ex['id_issue_date']; + if (!empty($ex['license_issue_date'])) $data['licenseIssueDate'] = $ex['license_issue_date']; + if (!empty($ex['license_expiry_date'])) $data['expiry_date'] = $ex['license_expiry_date']; + if (!empty($ex['license_category'])) $data['license_categories'] = $ex['license_category']; + // Not mapped directly in basic DB schema but extracted: blood_type, civil_registry, birth_place + } + + if ($json && isset($json['car'])) { + $ex = $json['car']; + if (!empty($ex['car_plate'])) $car['car_plate'] = $ex['car_plate']; + if (!empty($ex['make'])) $car['make'] = $ex['make']; + if (!empty($ex['model'])) $car['model'] = $ex['model']; + if (!empty($ex['year'])) $car['year'] = $ex['year']; + if (!empty($ex['color'])) $car['color'] = $ex['color']; + if (!empty($ex['color_hex'])) $car['color_hex'] = $ex['color_hex']; + if (!empty($ex['vin'])) $car['vin'] = $ex['vin']; + if (!empty($ex['owner'])) $car['owner'] = $ex['owner']; + if (!empty($ex['fuel'])) $car['fuel'] = $ex['fuel']; + } + } + } + /* ================== AI PROCESSING END ================== */ + /* ================== 2) Generate default id/email ================== */ if (empty($data['id'])) { $data['id'] = 'DRV' . date('YmdHis') . random_int(1000, 9999); @@ -320,6 +477,7 @@ $pwdHashed = password_hash($rawSecret, PASSWORD_DEFAULT); "); foreach ($docKeys as $k) { + if (!isset($docUrls[$k])) continue; $url = $docUrls[$k]; $name = basename(parse_url($url, PHP_URL_PATH) ?? ''); if ($name === '') { $name = $k . '_' . time() . '.jpg'; } @@ -330,6 +488,18 @@ $pwdHashed = password_hash($rawSecret, PASSWORD_DEFAULT); ':image_name' => $name, ':link' => $url, ]); + + if ($k === 'profile_picture') { + $insProfile = $con->prepare(" + INSERT INTO imageProfileCaptain (driverID, image_name, link) + VALUES (:driverID, :image_name, :link) + "); + $insProfile->execute([ + ':driverID' => $driverID, + ':image_name' => $name, + ':link' => $url, + ]); + } } /* ================== 10) Commit ================== */ diff --git a/backend/auth/syria/uploadSyrianDocs.php b/backend/auth/syria/uploadSyrianDocs.php index bb0cd2f..a761241 100755 --- a/backend/auth/syria/uploadSyrianDocs.php +++ b/backend/auth/syria/uploadSyrianDocs.php @@ -10,12 +10,17 @@ const MAX_FILE_MB = 5; const ALLOWED_MIMES = ['image/jpeg','image/png','image/webp']; // فقط صور const UPLOAD_ROOT = __DIR__ . "/../../private_uploads"; // مجلد خاص (غير عام) const SIGN_SECRET = getenv('SECRET_KEY_HMAC'); // غيّرها واقرأها من .env -const PUBLIC_BASE = 'https://syria.intaleq.xyz/siro'; // الدومين العلني +$host = $_SERVER['HTTP_HOST'] ?? 'api-syria.siromove.com'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +define('PUBLIC_BASE', "$protocol://$host/siro"); const SIGNED_TTL_SEC = 172800; // 2 days = 60*60*24 // أنشئ مجلد الرفع إن لم يكن موجودًا if (!is_dir(UPLOAD_ROOT)) { @mkdir(UPLOAD_ROOT, 0700, true); } +// Log entry +uploadLog("🚀 [uploadSyrianDocs.php] Document upload script started."); + // (اختياري) هيدرز أمان $authHeader = $_SERVER['HTTP_AUTHORIZATION'] ?? ''; $hmacHeader = $_SERVER['HTTP_X_HMAC_AUTH'] ?? ''; @@ -26,7 +31,10 @@ $driverId = filterRequest('driver_id'); $docType = filterRequest('doc_type'); $purpose = filterRequest('purpose'); // اختياري +uploadLog("📥 Request params: driver_id=$driverId, doc_type=$docType"); + if (empty($driverId) || empty($docType)) { + uploadLog("❌ Missing driver_id or doc_type params.", 'ERROR'); jsonError("driver_id and doc_type are required."); exit; } @@ -39,12 +47,26 @@ $allowedDocTypes = [ 'car_license_back', ]; if (!in_array($docType, $allowedDocTypes, true)) { + uploadLog("❌ Invalid doc_type value: $docType", 'ERROR'); jsonError("Invalid doc_type."); exit; } // --------- التحقق من الملف --------- +if (isset($_FILES['file'])) { + uploadLog("$_FILES['file'] metadata", 'INFO', [ + 'name' => $_FILES['file']['name'] ?? 'unknown', + 'type' => $_FILES['file']['type'] ?? 'unknown', + 'size' => $_FILES['file']['size'] ?? 0, + 'upload_error_code' => $_FILES['file']['error'] ?? UPLOAD_ERR_OK + ]); +} else { + uploadLog("No 'file' payload was sent in the request.", 'WARNING'); +} + if (!isset($_FILES['file']) || $_FILES['file']['error'] !== UPLOAD_ERR_OK) { + $err = $_FILES['file']['error'] ?? 'missing_file'; + uploadLog("❌ File upload validation failed. Code: $err", 'ERROR'); jsonError("No file uploaded or upload error."); exit; } @@ -116,6 +138,7 @@ $fileUrl = PUBLIC_BASE . "/secure_image.php" . "&signature={$signature}"; // --------- استجابة --------- +uploadLog("✅ Document upload succeeded. URL: $fileUrl"); printSuccess([ "status" => "success", "success_file" => true, diff --git a/backend/core/helpers.php b/backend/core/helpers.php index 25ffa1c..b8a6ada 100644 --- a/backend/core/helpers.php +++ b/backend/core/helpers.php @@ -172,6 +172,42 @@ function appLog(string $message, string $level = 'INFO'): void @error_log($entry . PHP_EOL, 3, $logDir . '/app.log'); } +function uploadLog(string $message, string $level = 'INFO', array $context = []): void +{ + $logDir = __DIR__ . '/../logs'; + if (!is_dir($logDir)) { + @mkdir($logDir, 0777, true); + } + + if (!isset($context['ip'])) { + $context['ip'] = $_SERVER['REMOTE_ADDR'] ?? 'unknown'; + } + if (!isset($context['user_agent'])) { + $context['user_agent'] = $_SERVER['HTTP_USER_AGENT'] ?? 'unknown'; + } + + if (isset($context['upload_error_code'])) { + $errCode = $context['upload_error_code']; + $context['upload_error_desc'] = match ($errCode) { + UPLOAD_ERR_OK => 'UPLOAD_ERR_OK (0): No error, file uploaded successfully.', + UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE (1): The uploaded file exceeds the upload_max_filesize directive in php.ini.', + UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE (2): The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', + UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL (3): The uploaded file was only partially uploaded (common on weak/3G networks).', + UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE (4): No file was uploaded.', + UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR (6): Missing a temporary folder.', + UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE (7): Failed to write file to disk.', + UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION (8): A PHP extension stopped the file upload.', + default => "Unknown upload error code: $errCode", + }; + } + + $entry = date('Y-m-d H:i:s') . " [$level] " . $message; + if ($context) { + $entry .= ' | ' . json_encode($context, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + } + @error_log($entry . PHP_EOL, 3, $logDir . '/upload.log'); +} + function debugLog(string $message): void { appLog($message, 'DEBUG'); diff --git a/backend/ride/card-image-driver/add.php b/backend/ride/card-image-driver/add.php index d5e3c80..4fdfe0d 100644 --- a/backend/ride/card-image-driver/add.php +++ b/backend/ride/card-image-driver/add.php @@ -4,15 +4,31 @@ require_once __DIR__ . '/../../functions.php'; header('Content-Type: application/json'); +uploadLog("🚀 [ride/card-image-driver/add.php] Card image upload started."); + try { $con = Database::get('main'); } catch (Exception $e) { + uploadLog("❌ DB Connection failed: " . $e->getMessage(), 'ERROR'); http_response_code(500); echo json_encode(['status' => 'Database connection failed.']); exit; } +if (isset($_FILES['image'])) { + uploadLog("$_FILES['image'] metadata", 'INFO', [ + 'name' => $_FILES['image']['name'] ?? 'unknown', + 'type' => $_FILES['image']['type'] ?? 'unknown', + 'size' => $_FILES['image']['size'] ?? 0, + 'upload_error_code' => $_FILES['image']['error'] ?? UPLOAD_ERR_OK + ]); +} else { + uploadLog("No 'image' file was sent in request.", 'WARNING'); +} + if (!isset($_FILES['image']) || $_FILES['image']['error'] != UPLOAD_ERR_OK) { + $err = $_FILES['image']['error'] ?? 'missing_file'; + uploadLog("❌ File upload validation failed. Code: $err", 'ERROR'); echo json_encode(['status' => 'The image file was not uploaded successfully.']); exit; } @@ -21,6 +37,7 @@ $image_file = $_FILES['image']; $driverID = filterRequest("driver_id"); if (empty($driverID)) { + uploadLog("❌ Missing driver_id parameter.", 'ERROR'); echo json_encode(['status' => 'Missing driver ID.']); exit; } @@ -58,7 +75,9 @@ if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { exit; } -$linlImage = 'https://ride.mobile-app.store/card_image/' . $new_filename; +$host = $_SERVER['HTTP_HOST'] ?? 'ride.mobile-app.store'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +$linlImage = "$protocol://$host/siro/card_image/" . $new_filename; try { // استخدام Prepared Statements للحماية من الحقن (SQL Injection) @@ -73,6 +92,7 @@ try { ':driver_id' => $driverID ]); + uploadLog("✅ Card image updated successfully for driver_id: $driverID, URL: $linlImage"); echo json_encode(['status' => 'Record updated successfully']); } else { $insertStmt = $con->prepare("INSERT INTO card_images (id, driver_id, image_name, link) VALUES (SHA2(UUID(), 256), :driver_id, :image_name, :link)"); @@ -82,9 +102,11 @@ try { ':link' => $linlImage ]); + uploadLog("✅ Card image inserted successfully for driver_id: $driverID, URL: $linlImage"); echo json_encode(['status' => 'Record inserted successfully']); } } catch (PDOException $e) { + uploadLog("❌ Database error: " . $e->getMessage(), 'ERROR'); error_log("Database Error in card-image-driver/add.php: " . $e->getMessage()); echo json_encode(['status' => 'Database operation failed.']); } diff --git a/backend/uploadImagePortrate.php b/backend/uploadImagePortrate.php index dc79770..1961893 100755 --- a/backend/uploadImagePortrate.php +++ b/backend/uploadImagePortrate.php @@ -6,17 +6,30 @@ require_once __DIR__ . '/connect.php'; // يفترض أنه يستدعي core/bootstrap.php -appLog("🚀 [upload_profile_image.php] بدأ تنفيذ سكربت رفع الصورة"); +uploadLog("🚀 [uploadImagePortrate.php] Profile image upload script execution started."); try { + // Check if $_FILES has errors + if (isset($_FILES['image'])) { + uploadLog("$_FILES['image'] metadata", 'INFO', [ + 'name' => $_FILES['image']['name'] ?? 'unknown', + 'type' => $_FILES['image']['type'] ?? 'unknown', + 'size' => $_FILES['image']['size'] ?? 0, + 'upload_error_code' => $_FILES['image']['error'] ?? UPLOAD_ERR_OK + ]); + } else { + uploadLog("No 'image' file was sent in the request.", 'WARNING'); + } + // 1. Rate Limiting للرفع $limiter = new RateLimiter($redis); $limiter->enforce(RateLimiter::identifier($user_id ?? null), 'upload'); $driverID = filterRequest("driverID"); - appLog("📥 Received driverID: $driverID"); + uploadLog("📥 Received driverID: $driverID"); if (empty($driverID)) { + uploadLog("❌ Driver ID is missing.", 'ERROR'); jsonError('Driver ID is required.', 400); } @@ -25,16 +38,18 @@ try { $uploadResult = uploadImageSecure('image', $target_dir, $driverID); if (!$uploadResult['success']) { + uploadLog("❌ Image upload failed", 'ERROR', ['driverID' => $driverID, 'error' => $uploadResult['error']]); securityLog("❌ Image upload failed", ['driverID' => $driverID, 'error' => $uploadResult['error']]); jsonError($uploadResult['error'], 400); } $new_filename = $uploadResult['filename']; - appLog("✅ File moved successfully to: " . $uploadResult['path']); + uploadLog("✅ File moved successfully to: " . $uploadResult['path']); - // 3. تحديث قاعدة البيانات - $linkImage = 'https://api.intaleq.xyz/siro_v3/portrate_captain_image/' . $new_filename; - $uploadDate = date("Y-m-d H:i:s"); + // 3. تحديث قاعدة البيانات ديناميكياً + $host = $_SERVER['HTTP_HOST'] ?? 'api.siromove.com'; + $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; + $linkImage = "$protocol://$host/siro/portrate_captain_image/" . $new_filename; // تأكد من أن الاتصال قادم من connect.php أو اجلبه $con = Database::get('main'); @@ -48,7 +63,6 @@ try { // تحديث $updateSQL = "UPDATE imageProfileCaptain SET image_name = ?, link = ? WHERE driverID = ?"; $updateStmt = $con->prepare($updateSQL); - // Note: imageProfileCaptain doesn't seem to have 'upload_date' in the original insert, but let's check if we should add it. Let's just update image_name and link as in the insert statement. $success = $updateStmt->execute([$new_filename, $linkImage, $driverID]); } else { // إدخال جديد @@ -58,10 +72,10 @@ try { } if ($success) { - appLog("✅ Record updated for driverID: $driverID"); + uploadLog("✅ Record updated for driverID: $driverID, Link: $linkImage"); jsonSuccess(['file_link' => $linkImage], 'Record updated successfully.'); } else { - appLog("❌ Failed to update DB record for driverID: $driverID"); + uploadLog("❌ Failed to update DB record for driverID: $driverID", 'ERROR'); jsonError('Failed to update record.', 500); } diff --git a/backend/upload_audio.php b/backend/upload_audio.php index 6136bc5..7e92a89 100755 --- a/backend/upload_audio.php +++ b/backend/upload_audio.php @@ -51,8 +51,10 @@ if (!move_uploaded_file($audio_file['tmp_name'], $target_file)) { exit; } -// Construct the link to the uploaded audio file -$base_url = 'https://api.intaleq.xyz/siro_v3/upload_audio/'; // Updated to match Siro V3 +// Construct the link to the uploaded audio file dynamically +$host = $_SERVER['HTTP_HOST'] ?? 'api.siromove.com'; +$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http"; +$base_url = "$protocol://$host/siro/upload_audio/"; $linkAudio = $base_url . $new_filename; diff --git a/siro_admin/lib/constant/links.dart b/siro_admin/lib/constant/links.dart index 2298d7e..072f702 100644 --- a/siro_admin/lib/constant/links.dart +++ b/siro_admin/lib/constant/links.dart @@ -1,6 +1,6 @@ import '../env/env.dart'; - -class AppLink { +import '../main.dart'; +import 'box_name.dart';class AppLink { static String seferPaymentServer = 'https://walletintaleq.intaleq.xyz/v1/main'; static final String tripzPaymentServer0 = seferPaymentServer; @@ -11,15 +11,64 @@ class AppLink { // static final String endPoint = box.read(BoxName.serverChosen); // static final String server = Env.seferCairoServer; - static final String server = 'https://api.intaleq.xyz/siro_v3'; - static final String endPoint = 'https://api.intaleq.xyz/siro_v3'; - static final String syria = 'https://syria.intaleq.xyz/siro'; - static String paymentServer = 'https://walletintaleq.intaleq.xyz/v1/main'; - static String locationServer = 'https://location.intaleq.xyz/siro/ride/location'; - static String locationServerSide = 'https://location.intaleq.xyz/siro/ride/location'; - static String mapSaasRoute = 'https://map-saas.intaleqapp.com/api/maps/route'; - static String mapSaasPlaces = 'https://map-saas.intaleqapp.com/api/geocoding/places'; - static const String routeApiBaseUrl = "https://routesjo.intaleq.xyz/route/v1/driving"; + static String get currentCountry => box.read('countryCode') ?? 'Jordan'; + + static String get server { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro_v3'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro_v3'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro_v3'; + default: return 'https://api.siromove.com/siro_v3'; + } + } + static String get endPoint => server; + static String get syria => 'https://api-syria.siromove.com/siro'; + + static String get paymentServer { + switch (currentCountry) { + case 'Syria': return 'https://wallet-syria.siromove.com/v1/main'; + case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; + case 'Jordan': return 'https://wallet-jordan.siromove.com/v1/main'; + default: return 'https://wallet.siromove.com/v1/main'; + } + } + + static String get locationServer { + switch (currentCountry) { + case 'Syria': return 'https://location-syria.siromove.com/siro/ride/location'; + case 'Egypt': return 'https://location-egypt.siromove.com/siro/ride/location'; + case 'Jordan': return 'https://location-jordan.siromove.com/siro/ride/location'; + default: return 'https://location.siromove.com/siro/ride/location'; + } + } + static String get locationServerSide => locationServer; + + static String get mapSaasRoute { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/maps/route'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/maps/route'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/maps/route'; + default: return 'https://map-saas.intaleqapp.com/api/maps/route'; + } + } + + static String get mapSaasPlaces { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/places'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/places'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/places'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/places'; + } + } + + static String get routeApiBaseUrl { + switch (currentCountry) { + case 'Syria': return 'https://routes-syria.siromove.com/route/v1/driving'; + case 'Egypt': return 'https://routes-egypt.siromove.com/route/v1/driving'; + case 'Jordan': return 'https://routes-jordan.siromove.com/route/v1/driving'; + default: return 'https://routes.siromove.com/route/v1/driving'; + } + } static String loginJwtDriver = "https://api.intaleq.xyz/siro/loginAdmin.php"; //============================= diff --git a/siro_admin/lib/controller/firebase/firbase_messge.dart b/siro_admin/lib/controller/firebase/firbase_messge.dart index 3e6f59c..f491279 100644 --- a/siro_admin/lib/controller/firebase/firbase_messge.dart +++ b/siro_admin/lib/controller/firebase/firbase_messge.dart @@ -20,6 +20,7 @@ import '../../views/widgets/elevated_btn.dart'; import '../functions/encrypt_decrypt.dart'; import '../notification_controller.dart'; import 'local_notification.dart'; +import 'notification_service.dart'; import 'token_access.dart'; class FirebaseMessagesController extends GetxController { @@ -364,66 +365,6 @@ class FirebaseMessagesController extends GetxController { // )); // } - void sendNotificationAll(String title, body) async { - // Get the token you want to subtract. - String token = box.read(BoxName.tokenFCM); - tokens = box.read(BoxName.tokens); - // Subtract the token from the list of tokens. - tokens.remove(token); - - // Save the list of tokens back to the box. - // box.write(BoxName.tokens, tokens); - tokens = box.read(BoxName.tokens); - for (var i = 0; i < tokens.length; i++) { - String serviceAccountKeyJson = '''{ - "type": "service_account", - "project_id": "ride-b1bd8", - "private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249", - "private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7/6qPvVb9B2MsLw/FxKiTFPuMG3bgKR9pbSFuJLYoaW7zqITOhVnYphGTqwAY\\nBVVcvISSLvELDmH9VZcv/9DVqVlqbbESHWh1Z4W6XGPoEqeDH/upNTyQQ/46Msgm\\nTGE6VqLHpWuSf6SqHp+r0Y0lI3vIPM1vz5FAJDJbOE/enHa0fSup0OHSMxl0HVMn\\nnO1yrGF3vsIPOej5HKr5d71bEIckzk73/yjNC1/mDQKBgQD7RtUvc9omsSsFMJ6e\\nBASAn6Dktx/QY/XNJjFzHQj69cywLDe5t5AL2gUi3phQ2oqB5XJdwnd5bTIEPEPZ\\nDOuOai2802p6FJk6kjmZAMVGx5JtXBH+vs6jrmQQSMiKbjwN1TT6xIWakvLOonUi\\nX6ZvjYYjU/E0YJU3jSiXWEr76wKBgQD5Zn4SouJ6BCDZMbausJVMBkk3qxsYooip\\np89WakC6e7AZinpkRcqjGGV9GOvc8crJs6fyXAA9ORepGP47Mc0ZrDssOkstznsM\\npr8R0S6MKwEZaT9ixOHdOcLZ47ps+JzA2Wr4KN2OvFHksUkB/46ATD1j9WZVgB8M\\namsYp/Y73QKBgHOo+PvsoZ9psVmkNX6abtAdqdtdB0HOoRea2uwXk0ig12TIFaZg\\nfedWpUKVnxqoXVTJHklV99RmlL0qWDiSH+LfsMnXro0e6iDxqZ1po2Se/CFmXcoa\\nXdctsFVmixhdATuExewfhTfPKABA+xWlXWC/jdy5CK+JPWXijaqMM4edAoGAE5Bj\\nsWiPpYyvWvpYX0nA3G7dzX0hqgQN/mkIjbnWDArp3IcNZNJIvBSM2Yxb7EAXbU0n\\njo6DAkp5Pa2VO+WDNlFZbvW/sf8xjeOCt44WPa6d7nVgIIpbQXRngZoopKW3/jTP\\n/FmQT8McFXmGxZ5belsAsdetSGW9icbLUerTGQ0CgYEAmf/G8Ag3XxmqTXvvHuv2\\n14OP7WnrVqkEMnydrftEwn4peXd/Lz+/GYX5Zc4ZoNgbN8IvZ5z0+OmRsallsbiW\\nBw0/tc68CjzxXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n", - "client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com", - "client_id": "111210077025005706623", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} -'''; // As defined above - - // Initialize AccessTokenManager - final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); - - // Obtain an OAuth 2.0 access token - final accessToken = await accessTokenManager.getAccessToken(); - - // Send the notification - final response = await http - .post( - Uri.parse( - 'https://fcm.googleapis.com/v1/projects/ride-b1bd8/messages:send'), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $accessToken', - }, - body: jsonEncode({ - 'notification': { - 'title': title, - 'body': body, - 'sound': 'ding.wav' - }, - 'priority': 'high', - 'data': { - 'click_action': 'FLUTTER_NOTIFICATION_CLICK', - 'id': '1', - 'status': 'done' - }, - 'to': tokens[i], - })) - .whenComplete(() {}) - .catchError((e) {}); - } - } - // for (var i = 0; i < tokens.length; i++) { // http // .post(Uri.parse('https://fcm.googleapis.com/fcm/send'), @@ -452,66 +393,18 @@ class FirebaseMessagesController extends GetxController { // } //android/app/src/main/res/raw/iphone_ringtone.wav - late String serviceAccountKeyJson; + void sendNotificationAll(String title, body) async { + // Deprecated: Admin panel notifications are sent via NotificationService. + } + void sendNotificationToAnyWithoutData( String title, String body, String token, String tone) async { - try { - var encryptedKey = Env.privateKeyFCM; - // Log.print('encryptedKey: ${encryptedKey}'); - serviceAccountKeyJson = - EncryptionHelper.instance.decryptData(encryptedKey); -// As defined above - - // Initialize AccessTokenManager - final accessTokenManager = AccessTokenManager(serviceAccountKeyJson); - - // Obtain an OAuth 2.0 access token - final accessToken = await accessTokenManager.getAccessToken(); - // Log.print('accessToken: ${accessToken}'); - - // Send the notification - final response = await http.post( - Uri.parse( - 'https://fcm.googleapis.com/v1/projects/siro-d48a7/messages:send'), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $accessToken', - }, - body: jsonEncode({ - 'message': { - 'token': token, - 'notification': { - 'title': title, - 'body': body, - }, - 'android': { - 'notification': { - 'sound': tone, - }, - }, - 'apns': { - 'payload': { - 'aps': { - 'sound': tone, - }, - }, - }, - }, - }), - ); - - if (response.statusCode == 200) { - SnackBar(content: Text('${response.statusCode}')); - print( - 'Notification sent successfully. Status code: ${response.statusCode}'); - print('Response body: ${response.body}'); - } else { - print( - 'Failed to send notification. Status code: ${response.statusCode}'); - print('Response body: ${response.body}'); - } - } catch (e) { - print('Error sending notification: $e'); - } + await NotificationService.sendNotification( + target: token, + title: title, + body: body, + category: 'fromAdmin', + tone: tone, + ); } } diff --git a/siro_admin/lib/controller/firebase/notification_service.dart b/siro_admin/lib/controller/firebase/notification_service.dart index c7b8acd..45ec415 100644 --- a/siro_admin/lib/controller/firebase/notification_service.dart +++ b/siro_admin/lib/controller/firebase/notification_service.dart @@ -1,12 +1,10 @@ import 'dart:convert'; import 'package:http/http.dart' as http; - -import '../../print.dart'; +import '../../constant/links.dart'; class NotificationService { // تأكد من أن هذا هو الرابط الصحيح لملف الإرسال - static const String _serverUrl = - 'https://syria.intaleq.xyz/siro/fcm/send_fcm.php'; + static String get _serverUrl => '${AppLink.server.replaceAll('_v3', '')}/ride/firebase/send_fcm.php'; static Future sendNotification({ required String target, diff --git a/siro_admin/lib/controller/firebase/token_access.dart b/siro_admin/lib/controller/firebase/token_access.dart index fc28ef8..2355212 100644 --- a/siro_admin/lib/controller/firebase/token_access.dart +++ b/siro_admin/lib/controller/firebase/token_access.dart @@ -1,53 +1,51 @@ -import 'dart:convert'; -import 'package:googleapis_auth/auth_io.dart'; +// import 'dart:convert'; -import '../../print.dart'; +// import '../../print.dart'; -class AccessTokenManager { - static final AccessTokenManager _instance = AccessTokenManager._internal(); - late final String serviceAccountJsonKey; - AccessToken? _accessToken; - DateTime? _expiryDate; +// class AccessTokenManager { +// static final AccessTokenManager _instance = AccessTokenManager._internal(); +// late final String serviceAccountJsonKey; +// DateTime? _expiryDate; - AccessTokenManager._internal(); +// AccessTokenManager._internal(); - factory AccessTokenManager(String jsonKey) { - if (_instance._isServiceAccountKeyInitialized()) { - // Prevent re-initialization - return _instance; - } - _instance.serviceAccountJsonKey = jsonKey; - return _instance; - } +// factory AccessTokenManager(String jsonKey) { +// if (_instance._isServiceAccountKeyInitialized()) { +// // Prevent re-initialization +// return _instance; +// } +// _instance.serviceAccountJsonKey = jsonKey; +// return _instance; +// } - bool _isServiceAccountKeyInitialized() { - try { - serviceAccountJsonKey; // Access to check if initialized - return true; - } catch (e) { - return false; - } - } +// bool _isServiceAccountKeyInitialized() { +// try { +// serviceAccountJsonKey; // Access to check if initialized +// return true; +// } catch (e) { +// return false; +// } +// } - Future getAccessToken() async { - if (_accessToken != null && DateTime.now().isBefore(_expiryDate!)) { - return _accessToken!.data; - } - try { - final serviceAccountCredentials = ServiceAccountCredentials.fromJson( - json.decode(serviceAccountJsonKey)); - final client = await clientViaServiceAccount( - serviceAccountCredentials, - ['https://www.googleapis.com/auth/firebase.messaging'], - ); +// Future getAccessToken() async { +// if (_accessToken != null && DateTime.now().isBefore(_expiryDate!)) { +// return _accessToken!.data; +// } +// try { +// final serviceAccountCredentials = ServiceAccountCredentials.fromJson( +// json.decode(serviceAccountJsonKey)); +// final client = await clientViaServiceAccount( +// serviceAccountCredentials, +// ['https://www.googleapis.com/auth/firebase.messaging'], +// ); - _accessToken = client.credentials.accessToken; - _expiryDate = client.credentials.accessToken.expiry; - client.close(); - Log.print('_accessToken!.data: ${_accessToken!.data}'); - return _accessToken!.data; - } catch (e) { - throw Exception('Failed to obtain access token'); - } - } -} +// _accessToken = client.credentials.accessToken; +// _expiryDate = client.credentials.accessToken.expiry; +// client.close(); +// Log.print('_accessToken!.data: ${_accessToken!.data}'); +// return _accessToken!.data; +// } catch (e) { +// throw Exception('Failed to obtain access token'); +// } +// } +// } diff --git a/siro_admin/lib/controller/functions/wallet.dart b/siro_admin/lib/controller/functions/wallet.dart index a8fdf61..5193920 100644 --- a/siro_admin/lib/controller/functions/wallet.dart +++ b/siro_admin/lib/controller/functions/wallet.dart @@ -29,12 +29,12 @@ class WalletController extends GetxController { 'driverID': driverID.toString(), }); if (res != 'failure') { - FirebaseMessagesController().sendNotificationToAnyWithoutData( - "لديك هدية من سفَر".tr, - 'لقد حصلت على هدية من سفر بقيمة $amount ', - token, // Access token correctly - 'ding.wav', - ); + // FirebaseMessagesController().sendNotificationToAnyWithoutData( + // "لديك هدية من سفَر".tr, + // 'لقد حصلت على هدية من سفر بقيمة $amount ', + // token, // Access token correctly + // 'ding.wav', + // ); Get.snackbar('success', 'addPaymentToDriver', backgroundColor: AppColor.greenColor); } else { diff --git a/siro_admin/lib/views/admin/captain/captain_details.dart b/siro_admin/lib/views/admin/captain/captain_details.dart index 9afd693..3e49b67 100644 --- a/siro_admin/lib/views/admin/captain/captain_details.dart +++ b/siro_admin/lib/views/admin/captain/captain_details.dart @@ -249,7 +249,8 @@ class CaptainDetailsPage extends StatelessWidget { borderRadius: BorderRadius.circular(12)), ), onPressed: () { - Get.to(() => DriverScorecardPage(driverId: data['id'].toString())); + Get.to( + () => DriverScorecardPage(driverId: data['id'].toString())); }, ), ), @@ -380,11 +381,11 @@ class CaptainDetailsPage extends StatelessWidget { // Check if key is valid (might be recreated) if (controller.formCaptainPrizeKey.currentState?.validate() ?? true) { - FirebaseMessagesController().sendNotificationToAnyWithoutData( - controller.titleNotify.text, - controller.bodyNotify.text, - data['passengerToken'] ?? '', // Safety check - 'order.wav'); + // FirebaseMessagesController().sendNotificationToAnyWithoutData( + // controller.titleNotify.text, + // controller.bodyNotify.text, + // data['passengerToken'] ?? '', // Safety check + // 'order.wav'); Get.back(); Get.snackbar("Success", "Notification Sent", backgroundColor: Colors.green.withOpacity(0.2)); diff --git a/siro_admin/lib/views/admin/passenger/passenger_details_page.dart b/siro_admin/lib/views/admin/passenger/passenger_details_page.dart index e2a678d..c0b4929 100644 --- a/siro_admin/lib/views/admin/passenger/passenger_details_page.dart +++ b/siro_admin/lib/views/admin/passenger/passenger_details_page.dart @@ -393,11 +393,11 @@ class PassengerDetailsPage extends StatelessWidget { onPressed: () { // Validate form safely if (controller.formPrizeKey.currentState?.validate() ?? false) { - FirebaseMessagesController().sendNotificationToAnyWithoutData( - controller.titleNotify.text, - controller.bodyNotify.text, - data['passengerToken'], - 'order.wav'); + // FirebaseMessagesController().sendNotificationToAnyWithoutData( + // controller.titleNotify.text, + // controller.bodyNotify.text, + // data['passengerToken'], + // 'order.wav'); Get.back(); Get.snackbar('Success', 'Notification sent successfully!', backgroundColor: Colors.green.withOpacity(0.2)); diff --git a/siro_admin/macos/Flutter/GeneratedPluginRegistrant.swift b/siro_admin/macos/Flutter/GeneratedPluginRegistrant.swift index a2f221b..edd2205 100644 --- a/siro_admin/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/siro_admin/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,7 +12,6 @@ import firebase_crashlytics import firebase_messaging import flutter_image_compress_macos import flutter_secure_storage_macos -import google_sign_in_ios import local_auth_darwin import sqflite_darwin import url_launcher_macos @@ -25,7 +24,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) - FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/siro_admin/pubspec.lock b/siro_admin/pubspec.lock index 33bfadb..e8bfe86 100644 --- a/siro_admin/pubspec.lock +++ b/siro_admin/pubspec.lock @@ -592,62 +592,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.3.3" - google_identity_services_web: - dependency: transitive - description: - name: google_identity_services_web - sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" - url: "https://pub.dev" - source: hosted - version: "0.3.3+1" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: d0a2c3bcb06e607bb11e4daca48bd4b6120f0bbc4015ccebbe757d24ea60ed2a - url: "https://pub.dev" - source: hosted - version: "6.3.0" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: d5e23c56a4b84b6427552f1cf3f98f716db3b1d1a647f16b96dbb5b93afa2805 - url: "https://pub.dev" - source: hosted - version: "6.2.1" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: "102005f498ce18442e7158f6791033bbc15ad2dcc0afa4cf4752e2722a516c96" - url: "https://pub.dev" - source: hosted - version: "5.9.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: "5f6f79cf139c197261adb6ac024577518ae48fdff8e53205c5373b5f6430a8aa" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: "460547beb4962b7623ac0fb8122d6b8268c951cf0b646dd150d60498430e4ded" - url: "https://pub.dev" - source: hosted - version: "0.12.4+4" - googleapis_auth: - dependency: "direct main" - description: - name: googleapis_auth - sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 - url: "https://pub.dev" - source: hosted - version: "1.6.0" graphs: dependency: transitive description: diff --git a/siro_admin/pubspec.yaml b/siro_admin/pubspec.yaml index e2cdb26..dbe95fb 100644 --- a/siro_admin/pubspec.yaml +++ b/siro_admin/pubspec.yaml @@ -48,7 +48,6 @@ dependencies: # google_maps_flutter: ^2.6.1 flutter_map: ^7.0.0 # مكتبة OpenStreetMap للفلاتر latlong2: ^0.9.1 - google_sign_in: ^6.2.1 http: ^1.0.0 # image: ^4.1.7 image_cropper: ^8.0.2 @@ -60,7 +59,6 @@ dependencies: sqflite: ^2.3.3+1 url_launcher: ^6.2.6 # webview_flutter: ^4.7.0 - googleapis_auth: ^1.6.0 firebase_crashlytics: ^4.2.0 flutter_image_compress: ^2.3.0 jwt_decoder: ^2.0.1 diff --git a/siro_driver/lib/constant/links.dart b/siro_driver/lib/constant/links.dart index 31d3123..b644699 100755 --- a/siro_driver/lib/constant/links.dart +++ b/siro_driver/lib/constant/links.dart @@ -4,31 +4,76 @@ import '../main.dart'; import 'box_name.dart'; class AppLink { -static String get serverPHP => box.read('serverPHP'); + static String get serverPHP => box.read('serverPHP'); + + static String get paymentServer { + switch (currentCountry) { + case 'Syria': return 'https://wallet-syria.siromove.com/v1/main'; + case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; + case 'Jordan': return 'https://wallet-jordan.siromove.com/v1/main'; + default: return 'https://wallet.siromove.com/v1/main'; + } + } -static String get paymentServer => 'https://walletintaleq.intaleq.xyz/v1/main'; static const String appDomain = 'siromove.com'; -static String get locationServer => - 'https://location.intaleq.xyz/siro/ride/location'; -static String get locationServerSide => - 'https://location.intaleq.xyz/siro/ride/location'; -static String get mapSaasRoute => 'https://map-saas.intaleqapp.com/api/maps/route'; -static String get mapSaasPlaces => - 'https://map-saas.intaleqapp.com/api/geocoding/places'; -static String get routeApiBaseUrl => - "https://routesjo.intaleq.xyz/route/v1/driving"; + static String get locationServer { + switch (currentCountry) { + case 'Syria': return 'https://location-syria.siromove.com/siro/ride/location'; + case 'Egypt': return 'https://location-egypt.siromove.com/siro/ride/location'; + case 'Jordan': + default: return 'https://location.siromove.com/siro/ride/location'; + } + } + + static String get locationServerSide { + switch (currentCountry) { + case 'Syria': return 'https://location-syria.siromove.com/siro/ride/location'; + case 'Egypt': return 'https://location-egypt.siromove.com/siro/ride/location'; + case 'Jordan': + default: return 'https://location.siromove.com/siro/ride/location'; + } + } + + static String get mapSaasRoute { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/maps/route'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/maps/route'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/maps/route'; + default: return 'https://map-saas.intaleqapp.com/api/maps/route'; + } + } + + static String get mapSaasPlaces { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/places'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/places'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/places'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/places'; + } + } + + static String get routeApiBaseUrl { + switch (currentCountry) { + case 'Syria': return "https://routes-syria.siromove.com/route/v1/driving"; + case 'Egypt': return "https://routes-egypt.siromove.com/route/v1/driving"; + case 'Jordan': return "https://routes-jordan.siromove.com/route/v1/driving"; + default: return "https://routes.siromove.com/route/v1/driving"; + } + } + static String get currentCountry => box.read(BoxName.countryCode) ?? 'Jordan'; static String get endPoint { switch (currentCountry) { case 'Syria': - return 'https://api-syria.siromove.com/intaleq_v3'; + return 'https://api-syria.siromove.com/siro'; case 'Egypt': - return 'https://api-egypt.siromove.com/intaleq_v3'; + return 'https://api-egypt.siromove.com/siro'; case 'Jordan': + return 'https://api-jordan.siromove.com/siro'; default: - return 'https://api-jordan.siromove.com/intaleq_v3'; + return 'https://api.siromove.com/siro'; } } @@ -37,424 +82,463 @@ static String get routeApiBaseUrl => ///=================ride==========================/// ///https://api.intaleq.xyz/siro/ride -static String get ride => '$server/ride'; -static String get rideServer => 'https://rides.intaleq.xyz/siro/ride'; + static String get ride => '$server/ride'; + static String get rideServer => 'https://rides.intaleq.xyz/siro/ride'; ///mapOSM = 'https://routesy.intaleq.xyz' -static String get mapOSM => 'https://routesy.intaleq.xyz'; + static String get mapOSM { + switch (currentCountry) { + case 'Syria': return 'https://routes-syria.siromove.com'; + case 'Egypt': return 'https://routes-egypt.siromove.com'; + case 'Jordan': return 'https://routes-jordan.siromove.com'; + default: return 'https://routes.siromove.com'; + } + } -static String get seferCairoServer => endPoint; -static String get seferGizaServer => + static String get seferCairoServer => endPoint; + static String get seferGizaServer => box.read('Giza') ?? box.read(BoxName.serverChosen); -static String get seferAlexandriaServer => + static String get seferAlexandriaServer => box.read('Alexandria') ?? box.read(BoxName.serverChosen); // static final String server = Env.serverPHP; -static String get loginJwtDriver => "$server/loginJwtDriver.php"; -static String get loginJwtWalletDriver => "$server/loginJwtWalletDriver.php"; -static String get loginFirstTimeDriver => "$server/loginFirstTimeDriver.php"; + static String get loginJwtDriver => "$server/loginJwtDriver.php"; + static String get loginJwtWalletDriver => "$server/loginJwtWalletDriver.php"; + static String get loginFirstTimeDriver => "$server/loginFirstTimeDriver.php"; -static String get googleMapsLink => 'https://maps.googleapis.com/maps/api/'; -static String get llama => 'https://api.llama-api.com/chat/completions'; -static String get gemini => + static String get googleMapsLink => 'https://maps.googleapis.com/maps/api/'; + static String get llama => 'https://api.llama-api.com/chat/completions'; + static String get gemini => 'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText'; -static String get test => "$server/test.php"; + static String get test => "$server/test.php"; //===============contact========================== -static String get savePhones => "$ride/egyptPhones/add.php"; -static String get savePhonesSyria => "$ride/egyptPhones/syrianAdd.php"; -static String get getPhones => "$ride/egyptPhones/get.php"; + static String get savePhones => "$ride/egyptPhones/add.php"; + static String get savePhonesSyria => "$ride/egyptPhones/syrianAdd.php"; + static String get getPhones => "$ride/egyptPhones/get.php"; ////===============firebase========================== -static String get getTokens => "$ride/firebase/get.php"; + static String get getTokens => "$ride/firebase/get.php"; -static String get getDriverToken => "$ride/firebase/getDriverToken.php"; -static String get addTokens => "$ride/firebase/add.php"; -static String get addTokensDriver => "$ride/firebase/addDriver.php"; -static String get addTokensDriverWallet => + static String get getDriverToken => "$ride/firebase/getDriverToken.php"; + static String get addTokens => "$ride/firebase/add.php"; + static String get addTokensDriver => "$ride/firebase/addDriver.php"; + static String get addTokensDriverWallet => "$paymentServer/ride/firebase/addDriver.php"; //=======================Wallet=================== -static String get wallet => '$paymentServer/ride/passengerWallet'; -static String get walletDriver => '$paymentServer/ride/driverWallet'; -static String get getAllPassengerTransaction => + static String get wallet => '$paymentServer/ride/passengerWallet'; + static String get walletDriver => '$paymentServer/ride/driverWallet'; + static String get getAllPassengerTransaction => "$wallet/getAllPassengerTransaction.php"; -static String get payWithMTNConfirm => + static String get payWithMTNConfirm => "$paymentServer/ride/mtn/driver/confirm_payment.php"; -static String get payWithMTNStart => + static String get payWithMTNStart => "$paymentServer/ride/mtn/driver/mtn_start.php"; -static String get payWithSyriatelConfirm => + static String get payWithSyriatelConfirm => "$paymentServer/ride/syriatel/driver/confirm_payment.php"; -static String get payWithSyriatelStart => + static String get payWithSyriatelStart => "$paymentServer/ride/syriatel/driver/start_payment.php"; - -static String get createMtnInvoice => "$paymentServer/ride/mtn_new/create_mtn_invoice.php"; -static String get uploadMtnProof => "$paymentServer/ride/mtn_new/verify_payment_ai.php"; -static String get checkMtnStatus => "$paymentServer/ride/mtn_new/check_status.php"; -static String get createCliqInvoice => "$paymentServer/ride/cliq/create_cliq_invoice.php"; -static String get uploadCliqProof => "$paymentServer/ride/cliq/verify_payment_ai.php"; -static String get checkCliqStatus => "$paymentServer/ride/cliq/check_status.php"; + static String get createMtnInvoice => + "$paymentServer/ride/mtn_new/create_mtn_invoice.php"; + static String get uploadMtnProof => + "$paymentServer/ride/mtn_new/verify_payment_ai.php"; + static String get checkMtnStatus => + "$paymentServer/ride/mtn_new/check_status.php"; -static String get payWithEcashDriver => + static String get createCliqInvoice => + "$paymentServer/ride/cliq/create_cliq_invoice.php"; + static String get uploadCliqProof => + "$paymentServer/ride/cliq/verify_payment_ai.php"; + static String get checkCliqStatus => + "$paymentServer/ride/cliq/check_status.php"; + + static String get payWithEcashDriver => "$paymentServer/ride/ecash/driver/payWithEcash.php"; -static String get payWithEcashPassenger => + static String get payWithEcashPassenger => "$paymentServer/ride/ecash/passenger/payWithEcash.php"; // wl.tripz-egypt.com/v1/main/ride/ecash/driver -static String get getWalletByPassenger => "$wallet/getWalletByPassenger.php"; -static String get getPassengersWallet => "$wallet/get.php"; -static String get getPassengerWalletArchive => + static String get getWalletByPassenger => "$wallet/getWalletByPassenger.php"; + static String get getPassengersWallet => "$wallet/get.php"; + static String get getPassengerWalletArchive => "$wallet/getPassengerWalletArchive.php"; -static String get addPassengersWallet => "$wallet/add.php"; -static String get deletePassengersWallet => "$wallet/delete.php"; -static String get updatePassengersWallet => "$wallet/update.php"; + static String get addPassengersWallet => "$wallet/add.php"; + static String get deletePassengersWallet => "$wallet/delete.php"; + static String get updatePassengersWallet => "$wallet/update.php"; -static String get getWalletByDriver => "$walletDriver/getWalletByDriver.php"; -static String get transferWalletDriver => "$endPoint/ride/driverWallet/transfer.php"; -static String get convertBudgetToPoints => "$walletDriver/convertBudgetToPoints.php"; -static String get driverStatistic => + static String get getWalletByDriver => "$walletDriver/getWalletByDriver.php"; + static String get transferWalletDriver => + "$endPoint/ride/driverWallet/transfer.php"; + static String get convertBudgetToPoints => + "$walletDriver/convertBudgetToPoints.php"; + static String get driverStatistic => "$endPoint/ride/driverWallet/driverStatistic.php"; -static String get getDriverDetails => + static String get getDriverDetails => "$seferCairoServer/ride/driverWallet/getDriverDetails.php"; // ================= Gamification Endpoints ================= -static String get getWeeklyAggregate => + static String get getWeeklyAggregate => "$endPoint/ride/gamification/getWeeklyAggregate.php"; -static String get getLeaderboard => + static String get getLeaderboard => "$endPoint/ride/gamification/getLeaderboard.php"; -static String get claimChallengeReward => + static String get claimChallengeReward => "$endPoint/ride/gamification/claimChallengeReward.php"; -static String get getReferralStats => + static String get getReferralStats => "$endPoint/ride/gamification/getReferralStats.php"; -static String get getDriverBehavior => + static String get getDriverBehavior => "$endPoint/ride/gamification/getDriverBehavior.php"; -static String get getDriverWeekPaymentMove => + static String get getDriverWeekPaymentMove => "$walletDriver/getDriverWeekPaymentMove.php"; -static String get getDriversWallet => "$walletDriver/get.php"; -static String get addDriversWalletPoints => "$walletDriver/add.php"; -static String get addpromotionDriver => "$walletDriver/promotionDriver.php"; -static String get deleteDriversWallet => "$walletDriver/delete.php"; -static String get updateDriversWallet => "$walletDriver/update.php"; + static String get getDriversWallet => "$walletDriver/get.php"; + static String get addDriversWalletPoints => "$walletDriver/add.php"; + static String get addpromotionDriver => "$walletDriver/promotionDriver.php"; + static String get deleteDriversWallet => "$walletDriver/delete.php"; + static String get updateDriversWallet => "$walletDriver/update.php"; //=======================promo===================ride.mobile-app.store/ride/promo/get.php -static String get promo => '$server/ride/promo'; -static String get getPassengersPromo => "$promo/get.php"; -static String get getPromoBytody => "$promo/getPromoBytody.php"; -static String get addPassengersPromo => "$promo/add.php"; -static String get deletePassengersPromo => "$promo/delete.php"; -static String get updatePassengersPromo => "$promo/update.php"; + static String get promo => '$server/ride/promo'; + static String get getPassengersPromo => "$promo/get.php"; + static String get getPromoBytody => "$promo/getPromoBytody.php"; + static String get addPassengersPromo => "$promo/add.php"; + static String get deletePassengersPromo => "$promo/delete.php"; + static String get updatePassengersPromo => "$promo/update.php"; ////=======================cancelRide=================== -static String get addCancelRideFromPassenger => "$rideServer/cancelRide/add.php"; -static String get addCancelTripFromDriverAfterApplied => + static String get addCancelRideFromPassenger => + "$rideServer/cancelRide/add.php"; + static String get addCancelTripFromDriverAfterApplied => "$rideServer/cancelRide/addCancelTripFromDriverAfterApplied.php"; -static String get cancelRide => "$rideServer/cancelRide/get.php"; + static String get cancelRide => "$rideServer/cancelRide/get.php"; //-----------------ridessss------------------ -static String get addRides => "$rideServer/rides/add.php"; -static String get getRides => "$rideServer/rides/get.php"; -static String get getPlacesSyria => "$rideServer/places_syria/get.php"; -static String get getMishwari => "$rideServer/mishwari/get.php"; -static String get getMishwariDriver => "$rideServer/mishwari/getDriver.php"; -static String get sendChatMessage => "$server/ride/chat/send_message.php"; -static String get getTripCountByCaptain => + static String get addRides => "$rideServer/rides/add.php"; + static String get getRides => "$rideServer/rides/get.php"; + static String get getPlacesSyria => "$rideServer/places_syria/get.php"; + static String get getMishwari => "$rideServer/mishwari/get.php"; + static String get getMishwariDriver => "$rideServer/mishwari/getDriver.php"; + static String get sendChatMessage => "$server/ride/chat/send_message.php"; + static String get getTripCountByCaptain => "$rideServer/rides/getTripCountByCaptain.php"; -static String get getRideOrderID => "$rideServer/rides/getRideOrderID.php"; -static String get getRideStatus => "$rideServer/rides/getRideStatus.php"; -static String get getOverLayStatus => "$ride/overLay/get.php"; -static String get getArgumentAfterAppliedFromBackground => + static String get getRideOrderID => "$rideServer/rides/getRideOrderID.php"; + static String get getRideStatus => "$rideServer/rides/getRideStatus.php"; + static String get getOverLayStatus => "$ride/overLay/get.php"; + static String get getArgumentAfterAppliedFromBackground => "$ride/overLay/getArgumentAfterAppliedFromBackground.php"; -static String get addOverLayStatus => "$ride/overLay/add.php"; -static String get getapiKey => "$ride/apiKey/get.php"; + static String get addOverLayStatus => "$ride/overLay/add.php"; + static String get getapiKey => "$ride/apiKey/get.php"; -static String get getapiKeySefer => "$ride/apiKey/get.php"; -static String get getRideStatusBegin => "$rideServer/rides/getRideStatusBegin.php"; -static String get getRideStatusFromStartApp => + static String get getapiKeySefer => "$ride/apiKey/get.php"; + static String get getRideStatusBegin => + "$rideServer/rides/getRideStatusBegin.php"; + static String get getRideStatusFromStartApp => "$rideServer/rides/getRideStatusFromStartApp.php"; -static String get updateRides => "$rideServer/rides/update.php"; -static String get updateRideAndCheckIfApplied => + static String get updateRides => "$rideServer/rides/update.php"; + static String get updateRideAndCheckIfApplied => "$rideServer/rides/updateRideAndCheckIfApplied.php"; -static String get updateStausFromSpeed => + static String get updateStausFromSpeed => "$rideServer/rides/updateStausFromSpeed.php"; -static String get deleteRides => "$rideServer/rides/delete.php"; + static String get deleteRides => "$rideServer/rides/delete.php"; //-----------------DriverPayment------------------ -static String get addDriverScam => "$ride/driver_scam/add.php"; -static String get getDriverScam => "$ride/driver_scam/get.php"; + static String get addDriverScam => "$ride/driver_scam/add.php"; + static String get getDriverScam => "$ride/driver_scam/get.php"; /////////---getKazanPercent===//////////// -static String get getKazanPercent => "$ride/kazan/get.php"; -static String get addKazanPercent => "$ride/kazan/add.php"; + static String get getKazanPercent => "$ride/kazan/get.php"; + static String get addKazanPercent => "$ride/kazan/add.php"; ////-----------------DriverPayment------------------ -static String get addDrivePayment => "$paymentServer/ride/payment/add.php"; -static String get payWithPayMobCardDriver => + static String get addDrivePayment => "$paymentServer/ride/payment/add.php"; + static String get payWithPayMobCardDriver => "$paymentServer/ride/payMob/paymob_driver/payWithCard.php"; -static String get payWithWallet => + static String get payWithWallet => "$paymentServer/ride/payMob/paymob_driver/payWithWallet.php"; -static String get paymetVerifyDriver => + static String get paymetVerifyDriver => "$paymentServer/ride/payMob/paymob_driver/paymet_verfy.php"; -static String get updatePaymetToPaid => + static String get updatePaymetToPaid => "$paymentServer/ride/payment/updatePaymetToPaid.php"; -static String get paymobPayoutDriverWallet => + static String get paymobPayoutDriverWallet => "$paymentServer/ride/payMob/paymob_driver/paymob_payout.php'"; -static String get addSeferWallet => "$paymentServer/ride/seferWallet/add.php"; -static String get getSeferWallet => "$paymentServer/ride/seferWallet/get.php"; -static String get addDriverPaymentPoints => + static String get addSeferWallet => "$paymentServer/ride/seferWallet/add.php"; + static String get getSeferWallet => "$paymentServer/ride/seferWallet/get.php"; + static String get addDriverPaymentPoints => "$paymentServer/ride/driverPayment/add.php"; -static String get addPaymentTokenDriver => + static String get addPaymentTokenDriver => "$paymentServer/ride/driverWallet/addPaymentToken.php"; //driverWallet/addPaymentToken.php -static String get addPaymentTokenPassenger => + static String get addPaymentTokenPassenger => "$paymentServer/ride/passengerWallet/addPaymentTokenPassenger.php"; -static String get getDriverPaymentPoints => + static String get getDriverPaymentPoints => "$paymentServer/ride/driverWallet/get.php"; -static String get getDriverPaymentToday => "$paymentServer/ride/payment/get.php"; -static String get getCountRide => "$rideServer/payment/getCountRide.php"; -static String get getAllPaymentFromRide => + static String get getDriverPaymentToday => + "$paymentServer/ride/payment/get.php"; + static String get getCountRide => "$rideServer/payment/getCountRide.php"; + static String get getAllPaymentFromRide => "$paymentServer/ride/payment/getAllPayment.php"; -static String get getAllPaymentVisa => + static String get getAllPaymentVisa => "$paymentServer/ride/payment/getAllPaymentVisa.php"; //-----------------Passenger NotificationCaptain------------------ -static String get addNotificationPassenger => + static String get addNotificationPassenger => "$ride/notificationPassenger/add.php"; -static String get getNotificationPassenger => + static String get getNotificationPassenger => "$ride/notificationPassenger/get.php"; -static String get updateNotificationPassenger => + static String get updateNotificationPassenger => "$ride/notificationPassenger/update.php"; //-----------------Driver NotificationCaptain------------------ -static String get addNotificationCaptain => "$ride/notificationCaptain/add.php"; -static String get addWaitingRide => "$ride/notificationCaptain/addWaitingRide.php"; -static String get deleteAvailableRide => + static String get addNotificationCaptain => + "$ride/notificationCaptain/add.php"; + static String get addWaitingRide => + "$ride/notificationCaptain/addWaitingRide.php"; + static String get deleteAvailableRide => "$ride/notificationCaptain/deleteAvailableRide.php"; -static String get updateWaitingRide => + static String get updateWaitingRide => "$ride/notificationCaptain/updateWaitingTrip.php"; -static String get getRideWaiting => + static String get getRideWaiting => "$endPoint/ride/notificationCaptain/getRideWaiting.php"; -static String get getNotificationCaptain => "$ride/notificationCaptain/get.php"; -static String get updateNotificationCaptain => + static String get getNotificationCaptain => + "$ride/notificationCaptain/get.php"; + static String get updateNotificationCaptain => "$ride/notificationCaptain/update.php"; -static String get deleteNotificationCaptain => + static String get deleteNotificationCaptain => "$ride/notificationCaptain/delete.php"; //-----------------Api Key------------------ -static String get addApiKey => "$ride/apiKey/add.php"; -static String get getApiKey => "$ride/apiKey/get.php"; -static String get getCnMap => "$server/auth/cnMap.php"; -static String get getPromptDriverDocumentsEgypt => + static String get addApiKey => "$ride/apiKey/add.php"; + static String get getApiKey => "$ride/apiKey/get.php"; + static String get getCnMap => "$server/auth/cnMap.php"; + static String get getPromptDriverDocumentsEgypt => "$server/auth/captin/getPromptDriverDocumentsEgypt.php"; -static String get updateApiKey => "$ride/apiKey/update.php"; -static String get deleteApiKey => "$ride/apiKey/delete.php"; -static String get checkPhoneNumberISVerfiedDriver => + static String get updateApiKey => "$ride/apiKey/update.php"; + static String get deleteApiKey => "$ride/apiKey/delete.php"; + static String get checkPhoneNumberISVerfiedDriver => "$auth/checkPhoneNumberISVerfiedDriver.php"; -static String get getTesterApp => "$auth/Tester/getTesterApp.php"; -static String get updateTesterApp => "$auth/Tester/updateTesterApp.php"; + static String get getTesterApp => "$auth/Tester/getTesterApp.php"; + static String get updateTesterApp => "$auth/Tester/updateTesterApp.php"; //-----------------healthInsuranceProvider------------------ -static String get addHealthInsuranceProvider => "$server/driver_assurance/add.php"; -static String get getHealthInsuranceProvider => "$server/driver_assurance/get.php"; + static String get addHealthInsuranceProvider => + "$server/driver_assurance/add.php"; + static String get getHealthInsuranceProvider => + "$server/driver_assurance/get.php"; //-----------------Feed Back------------------ -static String get addFeedBack => "$ride/feedBack/add.php"; -static String get getFeedBack => "$ride/feedBack/get.php"; -static String get updateFeedBack => "$ride/feedBack/updateFeedBack.php"; -static String get add_solve_all => "$server/ride/feedBack/add_solve_all.php"; -static String get uploadAudio => "$server/upload_audio.php"; + static String get addFeedBack => "$ride/feedBack/add.php"; + static String get getFeedBack => "$ride/feedBack/get.php"; + static String get updateFeedBack => "$ride/feedBack/updateFeedBack.php"; + static String get add_solve_all => "$server/ride/feedBack/add_solve_all.php"; + static String get uploadAudio => "$server/upload_audio.php"; //-----------------Tips------------------ -static String get addTips => "$ride/tips/add.php"; -static String get getTips => "$ride/tips/get.php"; -static String get updateTips => "$ride/tips/update.php"; + static String get addTips => "$ride/tips/add.php"; + static String get getTips => "$ride/tips/get.php"; + static String get updateTips => "$ride/tips/update.php"; //-----------------Help Center------------------ -static String get addhelpCenter => "$ride/helpCenter/add.php"; -static String get gethelpCenter => "$ride/helpCenter/get.php"; -static String get getByIdhelpCenter => "$ride/helpCenter/getById.php"; -static String get updatehelpCenter => "$ride/helpCenter/update.php"; -static String get deletehelpCenter => "$ride/helpCenter/delete.php"; + static String get addhelpCenter => "$ride/helpCenter/add.php"; + static String get gethelpCenter => "$ride/helpCenter/get.php"; + static String get getByIdhelpCenter => "$ride/helpCenter/getById.php"; + static String get updatehelpCenter => "$ride/helpCenter/update.php"; + static String get deletehelpCenter => "$ride/helpCenter/delete.php"; //-----------------license------------------ -static String get addLicense => "$ride/license/add.php"; -static String get getLicense => "$ride/license/get.php"; -static String get updateLicense => "$ride/license/updateFeedBack.php"; + static String get addLicense => "$ride/license/add.php"; + static String get getLicense => "$ride/license/get.php"; + static String get updateLicense => "$ride/license/updateFeedBack.php"; //-----------------RegisrationCar------------------ -static String get addRegisrationCar => "$ride/RegisrationCar/add.php"; -static String get getRegisrationCar => "$endPoint/ride/RegisrationCar/get.php"; -static String get updateRegisrationCar => "$ride/RegisrationCar/update.php"; -static String get makeDefaultCar => "$ride/RegisrationCar/makeDefaultCar.php"; + static String get addRegisrationCar => "$ride/RegisrationCar/add.php"; + static String get getRegisrationCar => + "$endPoint/ride/RegisrationCar/get.php"; + static String get updateRegisrationCar => "$ride/RegisrationCar/update.php"; + static String get makeDefaultCar => "$ride/RegisrationCar/makeDefaultCar.php"; //-----------------DriverOrder------------------ -static String get addDriverOrder => "$ride/driver_order/add.php"; -static String get getDriverOrder => "$ride/driver_order/get.php"; -static String get getOrderCancelStatus => + static String get addDriverOrder => "$ride/driver_order/add.php"; + static String get getDriverOrder => "$ride/driver_order/get.php"; + static String get getOrderCancelStatus => "$ride/driver_order/getOrderCancelStatus.php"; -static String get updateDriverOrder => "$ride/driver_order/update.php"; -static String get deleteDriverOrder => "$ride/driver_order/delete.php"; + static String get updateDriverOrder => "$ride/driver_order/update.php"; + static String get deleteDriverOrder => "$ride/driver_order/delete.php"; // ===================================== -static String get addRateToPassenger => "$ride/rate/add.php"; -static String get addRateToDriver => "$ride/rate/addRateToDriver.php"; -static String get addRateApp => "$ride/rate/add_rate_app.php"; -static String get sendEmailRateingApp => "$ride/rate/sendEmailRateingApp.php"; -static String get getDriverRate => "$ride/rate/getDriverRate.php"; -static String get getPassengerRate => "$ride/rate/getPassengerRate.php"; + static String get addRateToPassenger => "$ride/rate/add.php"; + static String get addRateToDriver => "$ride/rate/addRateToDriver.php"; + static String get addRateApp => "$ride/rate/add_rate_app.php"; + static String get sendEmailRateingApp => "$ride/rate/sendEmailRateingApp.php"; + static String get getDriverRate => "$ride/rate/getDriverRate.php"; + static String get getPassengerRate => "$ride/rate/getPassengerRate.php"; ////////////////emails ============// -static String get sendEmailToPassengerForTripDetails => + static String get sendEmailToPassengerForTripDetails => "$ride/rides/emailToPassengerTripDetail.php"; -static String get sendEmailToDrivertransaction => + static String get sendEmailToDrivertransaction => "$server/Admin/sendEmailToDrivertransaction.php"; // =========================================== -static String get pathImage => "$server/upload/types/"; -static String get uploadImage => "$server/uploadImage.php"; -static String get uploadImage1 => "$server/uploadImage1.php"; -static String get uploadImagePortrate => "$server/uploadImagePortrate.php"; -static String get uploadSyrianDocs => "$syria/auth/syria/uploadSyrianDocs.php"; -static String get uploadImageType => "$server/uploadImageType.php"; + static String get pathImage => "$server/upload/types/"; + static String get uploadImage => "$server/uploadImage.php"; + static String get uploadImage1 => "$server/uploadImage1.php"; + static String get uploadImagePortrate => "$server/uploadImagePortrate.php"; + static String get uploadSyrianDocs => + "$syria/auth/syria/uploadSyrianDocs.php"; + static String get uploadImageType => "$server/uploadImageType.php"; //=============egypt documents ============== -static String get uploadEgyptidFront => + static String get uploadEgyptidFront => "$server/EgyptDocuments/uploadEgyptidFront.php"; -static String get uploadEgypt => "$server/uploadEgypt.php"; -static String get uploadEgypt1 => "$server/uploadEgypt1.php"; + static String get uploadEgypt => "$server/uploadEgypt.php"; + static String get uploadEgypt1 => "$server/uploadEgypt1.php"; //==================certifcate========== // static String location = '$endPoint/ride/location'; -static String get getCarsLocationByPassenger => "$locationServer/get.php"; -static String get addpassengerLocation => + static String get getCarsLocationByPassenger => "$locationServer/get.php"; + static String get addpassengerLocation => "$locationServer/addpassengerLocation.php"; -static String get getLocationAreaLinks => + static String get getLocationAreaLinks => "$locationServer/get_location_area_links.php"; -static String get getLatestLocationPassenger => + static String get getLatestLocationPassenger => "$locationServer/getLatestLocationPassenger.php"; -static String get getFemalDriverLocationByPassenger => + static String get getFemalDriverLocationByPassenger => "$locationServer/getFemalDriver.php"; -static String get getDriverCarsLocationToPassengerAfterApplied => + static String get getDriverCarsLocationToPassengerAfterApplied => "$locationServer/getDriverCarsLocationToPassengerAfterApplied.php"; -static String get addCarsLocationByPassenger => "$locationServer/add.php"; -static String get saveBehavior => "$locationServer/save_behavior.php"; -static String get addCarsLocationGizaEndpoint => "$locationServer/add.php"; -static String get addCarsLocationAlexandriaEndpoint => "$locationServer/add.php"; -static String get addCarsLocationCairoEndpoint => "$locationServer/add.php"; -static String get deleteCarsLocationByPassenger => "$locationServer/delete.php"; -static String get updateCarsLocationByPassenger => "$locationServer/update.php"; -static String get getTotalDriverDuration => + static String get addCarsLocationByPassenger => "$locationServer/add.php"; + static String get saveBehavior => "$locationServer/save_behavior.php"; + static String get addCarsLocationGizaEndpoint => "$locationServer/add.php"; + static String get addCarsLocationAlexandriaEndpoint => + "$locationServer/add.php"; + static String get addCarsLocationCairoEndpoint => "$locationServer/add.php"; + static String get deleteCarsLocationByPassenger => + "$locationServer/delete.php"; + static String get updateCarsLocationByPassenger => + "$locationServer/update.php"; + static String get getTotalDriverDuration => "$locationServer/getTotalDriverDuration.php"; -static String get getRidesDriverByDay => "$locationServer/getRidesDriverByDay.php"; -static String get getTotalDriverDurationToday => + static String get getRidesDriverByDay => + "$locationServer/getRidesDriverByDay.php"; + static String get getTotalDriverDurationToday => "$locationServer/getTotalDriverDurationToday.php"; //==================get_driver_behavior.php============= -static String get get_driver_behavior => + static String get get_driver_behavior => '$ride/driver_behavior/get_driver_behavior.php'; //==================cars new drivers============= -static String get addNewCarsDrivers => '$ride/carDrivers/add.php'; -static String get getNewCarsDrivers => '$ride/carDrivers/get.php'; -static String get deleteNewCarsDrivers => '$ride/carDrivers/delete.php'; + static String get addNewCarsDrivers => '$ride/carDrivers/add.php'; + static String get getNewCarsDrivers => '$ride/carDrivers/get.php'; + static String get deleteNewCarsDrivers => '$ride/carDrivers/delete.php'; //==================Blog============= -static String get profile => '$ride/profile'; -static String get getprofile => "$profile/get.php"; -static String get getCaptainProfile => "$profile/getCaptainProfile.php"; -static String get addprofile => "$profile/add.php"; -static String get deleteprofile => "$profile/delete.php"; -static String get updateprofile => "$profile/update.php"; -static String get updateDriverEmail => "$profile/updateDriverEmail.php"; + static String get profile => '$ride/profile'; + static String get getprofile => "$profile/get.php"; + static String get getCaptainProfile => "$profile/getCaptainProfile.php"; + static String get addprofile => "$profile/add.php"; + static String get deleteprofile => "$profile/delete.php"; + static String get updateprofile => "$profile/update.php"; + static String get updateDriverEmail => "$profile/updateDriverEmail.php"; //===================Auth============ -static String get getUnifiedCode => "$ride/invitor/get_unified_code.php"; -static String get addUnifiedInvite => "$ride/invitor/add_unified_invite.php"; -static String get claimDriverReward => "$ride/invitor/claim_driver_reward.php"; -static String get getDriverReferrals => "$ride/invitor/get_driver_referrals.php"; + static String get getUnifiedCode => "$ride/invitor/get_unified_code.php"; + static String get addUnifiedInvite => "$ride/invitor/add_unified_invite.php"; + static String get claimDriverReward => + "$ride/invitor/claim_driver_reward.php"; + static String get getDriverReferrals => + "$ride/invitor/get_driver_referrals.php"; -static String get addInviteDriver => "$ride/invitor/add.php"; -static String get addInvitationPassenger => + static String get addInviteDriver => "$ride/invitor/add.php"; + static String get addInvitationPassenger => "$ride/invitor/addInvitationPassenger.php"; -static String get getInviteDriver => "$ride/invitor/get.php"; -static String get getDriverInvitationToPassengers => + static String get getInviteDriver => "$ride/invitor/get.php"; + static String get getDriverInvitationToPassengers => "$ride/invitor/getDriverInvitationToPassengers.php"; -static String get updateInviteDriver => "$ride/invitor/update.php"; -static String get updatePassengerGift => + static String get updateInviteDriver => "$ride/invitor/update.php"; + static String get updatePassengerGift => "$server/ride/invitor/updatePassengerGift.php"; -static String get claimInviteReward => "$server/ride/invitor/claim.php"; -static String get updateInvitationCodeFromRegister => + static String get claimInviteReward => "$server/ride/invitor/claim.php"; + static String get updateInvitationCodeFromRegister => "$ride/invitor/updateInvitationCodeFromRegister.php"; -static String get register_driver_and_car => + static String get register_driver_and_car => "$auth/syria/driver/register_driver_and_car.php"; -static String get updateDriverInvitationDirectly => + static String get updateDriverInvitationDirectly => "$ride/invitor/updateDriverInvitationDirectly.php"; -static String get updatePassengersInvitation => + static String get updatePassengersInvitation => "$ride/invitor/updatePassengersInvitation.php"; //===================Auth============ -static String get auth => '$server/auth'; -static String get login => "$auth/login.php"; -static String get signUp => "$auth/signup.php"; -static String get updateDriverClaim => "$auth/captin/updateDriverClaim.php"; -static String get updateShamCashDriver => "$auth/captin/updateShamCashDriver.php"; -static String get sendVerifyEmail => "$auth/sendVerifyEmail.php"; -static String get passengerRemovedAccountEmail => + static String get auth => '$server/auth'; + static String get login => "$auth/login.php"; + static String get signUp => "$auth/signup.php"; + static String get updateDriverClaim => "$auth/captin/updateDriverClaim.php"; + static String get updateShamCashDriver => + "$auth/captin/updateShamCashDriver.php"; + static String get sendVerifyEmail => "$auth/sendVerifyEmail.php"; + static String get passengerRemovedAccountEmail => "$auth/passengerRemovedAccountEmail.php"; -static String get verifyEmail => "$auth/verifyEmail.php"; + static String get verifyEmail => "$auth/verifyEmail.php"; //===================Auth Captin============ -static String get authCaptin => '$server/auth/captin'; -static String get loginCaptin => "$authCaptin/login.php"; -static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php"; -static String get loginUsingCredentialsWithoutGoogle => + static String get authCaptin => '$server/auth/captin'; + static String get loginCaptin => "$authCaptin/login.php"; + static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php"; + static String get loginUsingCredentialsWithoutGoogle => "$authCaptin/loginUsingCredentialsWithoutGoogle.php"; -static String get packageInfo => "$server/auth/packageInfo.php"; -static String get signUpCaptin => "$authCaptin/register.php"; -static String get addCriminalDocuments => "$authCaptin/addCriminalDocuments.php"; -static String get sendVerifyEmailCaptin => "$authCaptin/sendVerifyEmail.php"; -static String get sendVerifyOtpMessage => + static String get packageInfo => "$server/auth/packageInfo.php"; + static String get signUpCaptin => "$authCaptin/register.php"; + static String get addCriminalDocuments => + "$authCaptin/addCriminalDocuments.php"; + static String get sendVerifyEmailCaptin => "$authCaptin/sendVerifyEmail.php"; + static String get sendVerifyOtpMessage => "$server/auth/captin/sendOtpMessageDriver.php"; -static String get verifyOtpMessage => "$server/auth/verifyOtpMessage.php"; -static String get verifyOtpDriver => "$server/auth/captin/verifyOtpDriver.php"; -static String get verifyEmailCaptin => "$authCaptin/verifyEmail.php"; -static String get removeUser => "$authCaptin/removeAccount.php"; -static String get deletecaptainAccounr => "$authCaptin/deletecaptainAccounr.php"; -static String get updateAccountBank => "$authCaptin/updateAccountBank.php"; -static String get getAccount => "$authCaptin/getAccount.php"; -static String get uploadImageToAi => "$auth/document_syria/ai_document.php"; -static String get isPhoneVerified => "$auth/syria/driver/isPhoneVerified.php"; + static String get verifyOtpMessage => "$server/auth/verifyOtpMessage.php"; + static String get verifyOtpDriver => + "$server/auth/captin/verifyOtpDriver.php"; + static String get verifyEmailCaptin => "$authCaptin/verifyEmail.php"; + static String get removeUser => "$authCaptin/removeAccount.php"; + static String get deletecaptainAccounr => + "$authCaptin/deletecaptainAccounr.php"; + static String get updateAccountBank => "$authCaptin/updateAccountBank.php"; + static String get getAccount => "$authCaptin/getAccount.php"; + static String get uploadImageToAi => "$auth/document_syria/ai_document.php"; + static String get isPhoneVerified => "$auth/syria/driver/isPhoneVerified.php"; //===================Admin Captin============ -static String get getPassengerDetailsByPassengerID => + static String get getPassengerDetailsByPassengerID => "$server/Admin/getPassengerDetailsByPassengerID.php"; -static String get getPassengerDetails => "$server/Admin/getPassengerDetails.php"; -static String get getPassengerbyEmail => "$server/Admin/getPassengerbyEmail.php"; -static String get addAdminUser => "$server/Admin/adminUser/add.php"; -static String get addError => "$server/Admin/errorApp.php"; -static String get getAdminUser => "$server/Admin/adminUser/get.php"; -static String get getCaptainDetailsByEmailOrIDOrPhone => + static String get getPassengerDetails => + "$server/Admin/getPassengerDetails.php"; + static String get getPassengerbyEmail => + "$server/Admin/getPassengerbyEmail.php"; + static String get addAdminUser => "$server/Admin/adminUser/add.php"; + static String get addError => "$server/Admin/errorApp.php"; + static String get getAdminUser => "$server/Admin/adminUser/get.php"; + static String get getCaptainDetailsByEmailOrIDOrPhone => "$server/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php"; -static String get getCaptainDetails => "$server/Admin/AdminCaptain/get.php"; -static String get getRidesPerMonth => + static String get getCaptainDetails => "$server/Admin/AdminCaptain/get.php"; + static String get getRidesPerMonth => "$server/Admin/AdminRide/getRidesPerMonth.php"; -static String get getRidesDetails => "$server/Admin/AdminRide/get.php"; + static String get getRidesDetails => "$server/Admin/AdminRide/get.php"; //////////Sms egypt/////////// -static String get sendSms => "https://sms.kazumi.me/api/sms/send-sms"; -static String get senddlr => "https://sms.kazumi.me/api/sms/send-dlr"; -static String get sendvalidity => "https://sms.kazumi.me/api/sms/send-validity"; -static String get sendmany => "https://sms.kazumi.me/api/sms/send-many"; -static String get checkCredit => "https://sms.kazumi.me/api/sms/check-credit"; -static String get checkStatus => "https://sms.kazumi.me/api/sms/check-status"; -static String get getSender => "$server/auth/sms/getSender.php"; -static String get updatePhoneInvalidSMS => + static String get sendSms => "https://sms.kazumi.me/api/sms/send-sms"; + static String get senddlr => "https://sms.kazumi.me/api/sms/send-dlr"; + static String get sendvalidity => + "https://sms.kazumi.me/api/sms/send-validity"; + static String get sendmany => "https://sms.kazumi.me/api/sms/send-many"; + static String get checkCredit => "https://sms.kazumi.me/api/sms/check-credit"; + static String get checkStatus => "https://sms.kazumi.me/api/sms/check-status"; + static String get getSender => "$server/auth/sms/getSender.php"; + static String get updatePhoneInvalidSMS => "$server/auth/sms/updatePhoneInvalidSMS.php"; //////////////service/////////// -static String get serviceApp => "$server/serviceapp"; -static String get getComplaintAllData => "$serviceApp/getComplaintAllData.php"; -static String get getComplaintAllDataForDriver => + static String get serviceApp => "$server/serviceapp"; + static String get getComplaintAllData => + "$serviceApp/getComplaintAllData.php"; + static String get getComplaintAllDataForDriver => "$serviceApp/getComplaintAllDataForDriver.php"; } diff --git a/siro_driver/lib/controller/auth/captin/register_captin_controller.dart b/siro_driver/lib/controller/auth/captin/register_captin_controller.dart index 247479b..199f6c5 100755 --- a/siro_driver/lib/controller/auth/captin/register_captin_controller.dart +++ b/siro_driver/lib/controller/auth/captin/register_captin_controller.dart @@ -279,9 +279,7 @@ class RegisterCaptainController extends GetxController { // box.read(BoxName.driverID).toString(), // box.read(BoxName.emailDriver).toString(), // ); - // Get.offAll(() => SyrianCardAI()); Get.to(() => RegistrationView()); - // } else { // Get.snackbar('title', 'message'); // } } @@ -313,7 +311,7 @@ class RegisterCaptainController extends GetxController { if (formKey.currentState!.validate()) { isLoading = true; update(); - Get.to(() => AiPage()); + Get.to(() => RegistrationView()); } } diff --git a/siro_driver/lib/controller/auth/google_sign.dart b/siro_driver/lib/controller/auth/google_sign.dart deleted file mode 100755 index 8886611..0000000 --- a/siro_driver/lib/controller/auth/google_sign.dart +++ /dev/null @@ -1,98 +0,0 @@ -import 'package:siro_driver/constant/box_name.dart'; -import 'package:siro_driver/controller/auth/captin/login_captin_controller.dart'; -import 'package:siro_driver/controller/functions/crud.dart'; -import 'package:siro_driver/main.dart'; -import 'package:siro_driver/views/auth/captin/cards/sms_signup.dart'; -import 'package:siro_driver/views/home/on_boarding_page.dart'; -import 'package:siro_driver/views/widgets/error_snakbar.dart'; -import 'package:get/get.dart'; -import 'package:google_sign_in/google_sign_in.dart'; - -import '../../views/auth/captin/ai_page.dart'; -import '../functions/add_error.dart'; -import '../functions/encrypt_decrypt.dart'; - -class GoogleSignInHelper { - static final GoogleSignIn _googleSignIn = GoogleSignIn.instance; - - // متغير ثابت لحفظ حالة المستخدم محلياً كبديل لخاصية currentUser المحذوفة - static GoogleSignInAccount? _cachedUser; - - static Future signIn() async { - try { - final GoogleSignInAccount? googleUser = - await _googleSignIn.authenticate(); - - if (googleUser != null) { - _cachedUser = googleUser; // حفظ الجلسة في الكاش المحلي - await _handleSignUp(googleUser); - - if (box.read(BoxName.countryCode) == 'Egypt') { - Get.to(() => SmsSignupEgypt()); - } else if (box.read(BoxName.countryCode) == 'Jordan') { - Get.to(() => AiPage()); - } - } - return googleUser; - } catch (error) { - return null; - } - } - - Future signInFromLogin() async { - try { - final GoogleSignInAccount? googleUser = - await _googleSignIn.authenticate(); - - if (googleUser != null) { - _cachedUser = googleUser; // حفظ الجلسة في الكاش المحلي - await _handleSignUp(googleUser); - - final driverID = - (box.read(BoxName.driverID)?.toString()) ?? 'Unknown ID'; - final emailDriver = - (box.read(BoxName.emailDriver)?.toString()) ?? 'Unknown Email'; - - print('Driver ID: $driverID'); - print('Driver Email: $emailDriver'); - - await Get.find() - .loginWithGoogleCredential(driverID, emailDriver); - } - - return googleUser; - } catch (error, stackTrace) { - mySnackeBarError('$error'); - CRUD.addError(error.toString(), stackTrace.toString(), - 'GoogleSignInAccount?> signInFromLogin()'); - return null; - } - } - - static Future _handleSignUp(GoogleSignInAccount user) async { - box.write(BoxName.driverID, (user.id) ?? 'Unknown ID'); - box.write(BoxName.emailDriver, (user.email) ?? 'Unknown Email'); - } - - static Future signOut() async { - try { - await _googleSignIn.signOut(); - } catch (error) { - // التعامل مع الخطأ بصمت إذا كانت جلسة جوجل فارغة مسبقاً - } finally { - _cachedUser = null; // مسح الكاش المحلي بشكل إلزامي - await _handleSignOut(); - } - } - - static Future _handleSignOut() async { - box.erase(); - storage.deleteAll(); - Get.offAll(OnBoardingPage()); - } - - // استخدام الكاش المحلي بدلاً من استدعاء المكتبة - static GoogleSignInAccount? getCurrentUser() { - return _cachedUser; - } -} diff --git a/siro_driver/lib/controller/auth/syria/registration_controller.dart b/siro_driver/lib/controller/auth/syria/registration_controller.dart index 1a080a1..ec77502 100644 --- a/siro_driver/lib/controller/auth/syria/registration_controller.dart +++ b/siro_driver/lib/controller/auth/syria/registration_controller.dart @@ -264,12 +264,23 @@ class RegistrationController extends GetxController { /// خريطة لتخزين روابط المستندات بعد الرفع final Map docUrls = { - 'driver_license_front': '', + 'id_front': '', + 'id_back': '', + 'driver_license': '', 'driver_license_back': '', + 'profile_picture': '', + 'criminal_record': '', 'car_license_front': '', 'car_license_back': '', }; + String getCriminalRecordTitle() { + String currentCountry = box.read(BoxName.countryCode) ?? 'Jordan'; + if (currentCountry == 'Syria') return 'لا حكم عليه'.tr; + if (currentCountry == 'Egypt') return 'فيش وتشبيه'.tr; + return 'عدم محكومية'.tr; + } + /// التصرّف العام لاختيار/قص/ضغط/رفع الصورة حسب type Future choosImage(String link, String imageType) async { try { @@ -329,58 +340,66 @@ class RegistrationController extends GetxController { } } - /// ترفع الملف وترجع رابط الصورة النهائي كـ String + /// ترفع الملف وترجع رابط الصورة النهائي كـ String مع إعادة المحاولة في حال فشل الاتصال Future uploadImage( File file, Map data, String link) async { - final uri = Uri.parse(link); - final request = http.MultipartRequest('POST', uri); + int maxRetries = 3; + int attempt = 0; + while (attempt < maxRetries) { + attempt++; + try { + final uri = Uri.parse(link); + final request = http.MultipartRequest('POST', uri); - // الهيدرز (كما عندك) - final headers = { - 'Authorization': - 'Bearer ${r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]}', - 'X-HMAC-Auth': '${box.read(BoxName.hmac)}', - }; - request.headers.addAll(headers); + final headers = { + 'Authorization': + 'Bearer ${r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]}', + 'X-HMAC-Auth': '${box.read(BoxName.hmac)}', + }; + request.headers.addAll(headers); - // اسم الملف: driverID.jpg (اختياري) - final forcedName = '${box.read(BoxName.driverID) ?? 'image'}.jpg'; + final forcedName = '${box.read(BoxName.driverID) ?? 'image'}.jpg'; - // إضافة الملف (من المسار مباشرة أسلم من الـ stream) - request.files.add( - await http.MultipartFile.fromPath( - 'image', // تأكد أنه نفس اسم الحقل على السيرفر - file.path, - filename: forcedName, - ), - ); + request.files.add( + await http.MultipartFile.fromPath( + 'image', + file.path, + filename: forcedName, + ), + ); - // الحقول الإضافية - data.forEach((k, v) => request.fields[k] = v); + data.forEach((k, v) => request.fields[k] = v); - // الإرسال - final streamed = await request.send(); - final res = await http.Response.fromStream(streamed); + // المهلة الزمنية 120 ثانية لتناسب الاتصالات الضعيفة + final streamed = await request.send().timeout(const Duration(seconds: 120)); + final res = await http.Response.fromStream(streamed); - if (res.statusCode != 200) { - throw Exception( - 'Failed to upload image: ${res.statusCode} - ${res.body}'); + if (res.statusCode != 200) { + throw Exception( + 'Failed to upload image: ${res.statusCode} - ${res.body}'); + } + + final body = jsonDecode(res.body); + final String? url = body['url'] ?? + body['file_link'] ?? + body['image_url'] ?? + (body['data'] is Map ? body['data']['url'] : null); + + if (url == null || url.isEmpty) { + throw Exception( + 'Upload succeeded but no image URL found in response: ${res.body}'); + } + + return url; + } catch (e) { + Log.print("⚠️ [Image Upload Attempt $attempt Failed] Error: $e"); + if (attempt >= maxRetries) { + rethrow; + } + await Future.delayed(Duration(seconds: attempt * 2)); + } } - - // نحاول استخراج رابط الصورة من أكثر من مفتاح محتمل - final body = jsonDecode(res.body); - final String? url = body['url'] ?? - body['file_link'] ?? - body['image_url'] ?? - (body['data'] is Map ? body['data']['url'] : null); - - if (url == null || url.isEmpty) { - // لو السيرفر يرجع هيكل مختلف، عدّل هنا المفتاح حسب استجابتك الفعلية - throw Exception( - 'Upload succeeded but no image URL found in response: ${res.body}'); - } - - return url; + throw Exception('Upload failed after $maxRetries attempts'); } Future compressImage(File file) async { @@ -398,7 +417,7 @@ class RegistrationController extends GetxController { return File(result!.path); } -// دالة رفع إلى السيرفر السوري: ترجع file_url (Signed URL) +// دالة رفع إلى السيرفر السوري مع مهلة 120 ثانية وإعادة محاولة تلقائية في حال الفشل Future uploadToSyria({ required String docType, required File file, @@ -406,79 +425,71 @@ class RegistrationController extends GetxController { required String authHeader, required String hmacHeader, required String driverId, - Duration timeout = const Duration(seconds: 60), + Duration timeout = const Duration(seconds: 120), http.Client? clientOverride, }) async { - final client = clientOverride ?? http.Client(); - try { - final mime = lookupMimeType(file.path) ?? 'image/jpeg'; - final parts = mime.split('/'); - - final req = http.MultipartRequest('POST', syrianUploadUri); - req.headers.addAll({ - 'Authorization': authHeader, - 'X-HMAC-Auth': hmacHeader, - }); - - req.fields['driver_id'] = driverId; - req.fields['doc_type'] = docType; - - req.files.add( - await http.MultipartFile.fromPath( - 'file', - file.path, - filename: p.basename(file.path), - contentType: MediaType(parts.first, parts.last), - ), - ); - - // ====== الطباعة قبل الإرسال ====== - // Log.print('--- Syrian Upload Request ---'); - // Log.print('URL: $syrianUploadUri'); - // // Log.print('Method: POST'); - // // Log.print('Headers: ${req.headers}'); - // Log.print('Fields: ${req.fields}'); - // // Log.print( - // // 'File: ${file.path} (${await file.length()} bytes, mime: $mime)'); - // Log.print('-----------------------------'); - - // الإرسال - final streamed = await client.send(req).timeout(timeout); - final resp = await http.Response.fromStream(streamed); - - // ====== الطباعة بعد الاستجابة ====== - // Log.print('--- Syrian Upload Response ---'); - Log.print('Status: ${resp.statusCode}'); - // Log.print('Headers: ${resp.headers}'); - // Log.print('Body: ${resp.body}'); - // Log.print('-------------------------------'); - - Map j = {}; + int maxRetries = 3; + int attempt = 0; + while (attempt < maxRetries) { + attempt++; + final client = clientOverride ?? http.Client(); try { - j = jsonDecode(resp.body) as Map; + final mime = lookupMimeType(file.path) ?? 'image/jpeg'; + final parts = mime.split('/'); + + final req = http.MultipartRequest('POST', syrianUploadUri); + req.headers.addAll({ + 'Authorization': authHeader, + 'X-HMAC-Auth': hmacHeader, + }); + + req.fields['driver_id'] = driverId; + req.fields['doc_type'] = docType; + + req.files.add( + await http.MultipartFile.fromPath( + 'file', + file.path, + filename: p.basename(file.path), + contentType: MediaType(parts.first, parts.last), + ), + ); + + final streamed = await client.send(req).timeout(timeout); + final resp = await http.Response.fromStream(streamed); + + Log.print('--- Syrian Upload Response (Attempt $attempt) ---'); + Log.print('Status: ${resp.statusCode}'); + + Map j = {}; + try { + j = jsonDecode(resp.body) as Map; + } catch (e) { + Log.print('⚠️ Failed to parse JSON: $e'); + } + + final statusOk = j['status'] == 'success'; + final fileUrl = (j['file_url'] ?? j['message']?['file_url'])?.toString(); + + if (resp.statusCode == 200 && + statusOk && + (fileUrl?.isNotEmpty ?? false)) { + return fileUrl!; + } + + throw Exception( + '❌ Syrian upload failed ($docType): ${j['message'] ?? resp.body}'); } catch (e) { - Log.print('⚠️ Failed to parse JSON: $e'); + Log.print("⚠️ [Syria Upload Attempt $attempt Failed] Error: $e"); + if (attempt >= maxRetries) { + rethrow; + } + await Future.delayed(Duration(seconds: attempt * 2)); + } finally { + if (clientOverride == null) client.close(); } - -// التحمّل لشكلين من الـ JSON: - final statusOk = j['status'] == 'success'; - final fileUrl = (j['file_url'] ?? j['message']?['file_url'])?.toString(); - final fileName = - (j['file_name'] ?? j['message']?['file_name'])?.toString(); - - if (resp.statusCode == 200 && - statusOk && - (fileUrl?.isNotEmpty ?? false)) { - // Log.print( - // '✅ Syrian upload success: $fileUrl (file: ${fileName ?? "-"})'); - return fileUrl!; - } - - throw Exception( - '❌ Syrian upload failed ($docType): ${j['message'] ?? resp.body}'); - } finally { - if (clientOverride == null) client.close(); } + throw Exception('Syrian upload failed after $maxRetries attempts'); } Future submitRegistration() async { @@ -490,19 +501,24 @@ class RegistrationController extends GetxController { } // 1) تحقق من وجود الروابط - final driverFrontUrl = docUrls['driver_license_front']; - final driverBackUrl = docUrls['driver_license_back']; + final idFrontUrl = docUrls['id_front']; + final idBackUrl = docUrls['id_back']; + final driverLicenseUrl = docUrls['driver_license']; + final driverLicenseBackUrl = docUrls['driver_license_back']; + final profilePicUrl = docUrls['profile_picture']; + final criminalRecordUrl = docUrls['criminal_record']; final carFrontUrl = docUrls['car_license_front']; final carBackUrl = docUrls['car_license_back']; - Log.print(driverFrontUrl.toString()); - Log.print(driverBackUrl.toString()); - Log.print(carFrontUrl.toString()); - Log.print(carBackUrl.toString()); - if (driverFrontUrl == null || - driverBackUrl == null || - carFrontUrl == null || - carBackUrl == null) { + final isSyria = box.read(BoxName.countryCode) == 'Syria'; + + if (idFrontUrl == null || idFrontUrl.isEmpty || + idBackUrl == null || idBackUrl.isEmpty || + driverLicenseUrl == null || driverLicenseUrl.isEmpty || + (isSyria && (driverLicenseBackUrl == null || driverLicenseBackUrl.isEmpty)) || + profilePicUrl == null || profilePicUrl.isEmpty || + carFrontUrl == null || carFrontUrl.isEmpty || + carBackUrl == null || carBackUrl.isEmpty) { mySnackbarWarning('Please wait for all documents to finish uploading before registering.'.tr); return; } @@ -607,10 +623,14 @@ class RegistrationController extends GetxController { } // --- روابط الصور --- - _addField(fields, 'driver_license_front', driverFrontUrl!); - _addField(fields, 'driver_license_back', driverBackUrl!); - _addField(fields, 'car_license_front', carFrontUrl!); - _addField(fields, 'car_license_back', carBackUrl!); + _addField(fields, 'id_front', idFrontUrl); + _addField(fields, 'id_back', idBackUrl); + _addField(fields, 'driver_license', driverLicenseUrl); + if (isSyria) _addField(fields, 'driver_license_back', driverLicenseBackUrl); + _addField(fields, 'profile_picture', profilePicUrl); + _addField(fields, 'criminal_record', criminalRecordUrl); + _addField(fields, 'car_license_front', carFrontUrl); + _addField(fields, 'car_license_back', carBackUrl); req.fields.addAll(fields); diff --git a/siro_driver/lib/controller/firebase/firbase_messge.dart b/siro_driver/lib/controller/firebase/firbase_messge.dart index d183550..9e57373 100755 --- a/siro_driver/lib/controller/firebase/firbase_messge.dart +++ b/siro_driver/lib/controller/firebase/firbase_messge.dart @@ -19,7 +19,6 @@ import '../../views/auth/captin/criminal_documents_page.dart'; import '../../views/home/Captin/home_captain/home_captin.dart'; import '../../views/home/Captin/orderCaptin/order_request_page.dart'; import '../../views/home/Captin/orderCaptin/vip_order_page.dart'; -import '../auth/google_sign.dart'; import '../functions/face_detect.dart'; import '../home/captin/map_driver_controller.dart'; import 'local_notification.dart'; @@ -219,7 +218,7 @@ class FirebaseMessagesController extends GetxController { case 'token change': case 'TOKEN_CHANGE': - GoogleSignInHelper.signOut(); + box.remove(BoxName.jwt); break; case 'face detect': diff --git a/siro_driver/lib/controller/firebase/notification_service.dart b/siro_driver/lib/controller/firebase/notification_service.dart index 5719456..3ee5816 100644 --- a/siro_driver/lib/controller/firebase/notification_service.dart +++ b/siro_driver/lib/controller/firebase/notification_service.dart @@ -1,10 +1,10 @@ import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:get/get.dart'; // للترجمة .tr +import '../../constant/links.dart'; class NotificationService { - static const String _serverUrl = - 'https://api.intaleq.xyz/siro/ride/firebase/send_fcm.php'; + static String get _serverUrl => '${AppLink.ride}/firebase/send_fcm.php'; static Future sendNotification({ required String target, diff --git a/siro_driver/lib/controller/functions/ocr_controller.dart b/siro_driver/lib/controller/functions/ocr_controller.dart index a3e3ec5..5384399 100755 --- a/siro_driver/lib/controller/functions/ocr_controller.dart +++ b/siro_driver/lib/controller/functions/ocr_controller.dart @@ -489,25 +489,58 @@ class ScanDocumentsByApi extends GetxController { final String token = box.read(BoxName.jwt)?.toString().split(AppInformation.addd)[0] ?? ''; final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? ''; + final String driverID = box.read(BoxName.driverID).toString(); + final String link = AppLink.uploadImagePortrate; - var request = http.MultipartRequest( - 'POST', - Uri.parse(AppLink.uploadImagePortrate), - ); + int maxRetries = 3; + int attempt = 0; + String responseString = ''; - request.files.add( - http.MultipartFile.fromBytes('image', imagePortrait), - ); + while (attempt < maxRetries) { + attempt++; + final client = http.Client(); + try { + Log.print('[UPLOAD_LOGGER] 🚀 [uploadImagePortrate] Attempt $attempt/$maxRetries started. Link: $link, Image Size: ${imagePortrait.length} bytes'); + + var request = http.MultipartRequest('POST', Uri.parse(link)); + request.files.add( + http.MultipartFile.fromBytes('image', imagePortrait, filename: '$driverID.jpg'), + ); - request.headers.addAll({ - 'Authorization': 'Bearer $token', - 'X-Device-FP': fingerPrint, - }); - request.fields['driverID'] = box.read(BoxName.driverID).toString(); + request.headers.addAll({ + 'Authorization': 'Bearer $token', + 'X-Device-FP': fingerPrint, + }); + request.fields['driverID'] = driverID; - var response = await request.send(); - var responseData = await response.stream.toBytes(); - var responseString = String.fromCharCodes(responseData); + final startTime = DateTime.now(); + var streamedResponse = await client.send(request).timeout(const Duration(seconds: 120)); + var res = await http.Response.fromStream(streamedResponse); + final duration = DateTime.now().difference(startTime); + + Log.print('[UPLOAD_LOGGER] 📥 [uploadImagePortrate] Attempt $attempt response received in ${duration.inSeconds}s. Status Code: ${res.statusCode}'); + Log.print('[UPLOAD_LOGGER] 📥 [uploadImagePortrate] Response Body: ${res.body}'); + + if (res.statusCode == 200) { + responseString = res.body; + break; // Success + } else { + throw Exception('Failed to upload portrait: ${res.statusCode} - ${res.body}'); + } + } catch (e, st) { + Log.print('[UPLOAD_LOGGER] ⚠️ [uploadImagePortrate] Attempt $attempt failed. Error: $e', stackTrace: st); + if (attempt >= maxRetries) { + isLoading = false; + update(); + rethrow; + } + final waitSeconds = attempt * 2; + Log.print('[UPLOAD_LOGGER] ⏳ Waiting $waitSeconds seconds before retrying...'); + await Future.delayed(Duration(seconds: waitSeconds)); + } finally { + client.close(); + } + } isLoading = false; update(); diff --git a/siro_driver/lib/controller/functions/upload_image.dart b/siro_driver/lib/controller/functions/upload_image.dart index 81cf9cc..ca5d890 100755 --- a/siro_driver/lib/controller/functions/upload_image.dart +++ b/siro_driver/lib/controller/functions/upload_image.dart @@ -303,83 +303,104 @@ class ImageController extends GetxController { } } - uploadImage(File file, Map data, String link) async { + Future _uploadMultipartFile({ + required File file, + required Map data, + required String link, + required String fileKey, + required String filename, + required String methodLabel, + }) async { final String token = r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]; final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? ''; + final int fileSizeBytes = await file.length(); - var request = http.MultipartRequest('POST', Uri.parse(link)); - Log.print('uploadImage -> $link'); + int maxRetries = 3; + int attempt = 0; - request.headers.addAll({ - 'Authorization': 'Bearer $token', - 'X-Device-FP': fingerPrint, - }); + while (attempt < maxRetries) { + attempt++; + final client = http.Client(); + try { + Log.print('[UPLOAD_LOGGER] 🚀 [$methodLabel] Attempt $attempt/$maxRetries started. Link: $link, File Size: $fileSizeBytes bytes'); + + var request = http.MultipartRequest('POST', Uri.parse(link)); + request.headers.addAll({ + 'Authorization': 'Bearer $token', + 'X-Device-FP': fingerPrint, + }); - var length = await file.length(); - var stream = http.ByteStream(file.openRead()); - request.files.add( - http.MultipartFile( - 'image', - stream, - length, - filename: '${box.read(BoxName.driverID)}.jpg', - ), - ); - data.forEach((key, value) { - request.fields[key] = value; - }); + var length = await file.length(); + var stream = http.ByteStream(file.openRead()); + request.files.add( + http.MultipartFile( + fileKey, + stream, + length, + filename: filename, + ), + ); + data.forEach((key, value) { + request.fields[key.toString()] = value.toString(); + }); - var myrequest = await request.send(); - var res = await http.Response.fromStream(myrequest); - Log.print('uploadImage response [${res.statusCode}]: ${res.body}'); - if (res.statusCode == 200) { - return jsonDecode(res.body); - } else { - throw Exception('Failed to upload image: ${res.statusCode} - ${res.body}'); + final startTime = DateTime.now(); + var streamedResponse = await client.send(request).timeout(const Duration(seconds: 120)); + var res = await http.Response.fromStream(streamedResponse); + final duration = DateTime.now().difference(startTime); + + Log.print('[UPLOAD_LOGGER] 📥 [$methodLabel] Attempt $attempt response received in ${duration.inSeconds}s. Status Code: ${res.statusCode}'); + Log.print('[UPLOAD_LOGGER] 📥 [$methodLabel] Response Body: ${res.body}'); + + if (res.statusCode == 200) { + final decoded = jsonDecode(res.body); + if (decoded is Map && decoded['status'] == 'failure') { + throw Exception('Server returned failure status: ${decoded['message']}'); + } + return decoded; + } else { + throw Exception('Failed to upload image: ${res.statusCode} - ${res.body}'); + } + } catch (e, st) { + Log.print('[UPLOAD_LOGGER] ⚠️ [$methodLabel] Attempt $attempt failed. Error: $e', stackTrace: st); + if (attempt >= maxRetries) { + rethrow; + } + final waitSeconds = attempt * 2; + Log.print('[UPLOAD_LOGGER] ⏳ Waiting $waitSeconds seconds before retrying...'); + await Future.delayed(Duration(seconds: waitSeconds)); + } finally { + client.close(); + } } + throw Exception('Upload failed after $maxRetries attempts'); + } + + uploadImage(File file, Map data, String link) async { + return _uploadMultipartFile( + file: file, + data: data, + link: link, + fileKey: 'image', + filename: '${box.read(BoxName.driverID)}.jpg', + methodLabel: 'uploadImage', + ); } uploadNewCar(File file, Map data, String link) async { - final String token = r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]; - final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? ''; - - var request = http.MultipartRequest('POST', Uri.parse(link)); - request.headers.addAll({ - 'Authorization': 'Bearer $token', - 'X-Device-FP': fingerPrint, - }); - - var length = await file.length(); - var stream = http.ByteStream(file.openRead()); - request.files.add( - http.MultipartFile( - 'image', - stream, - length, - filename: '${box.read(BoxName.driverID)}.jpg', - ), + return _uploadMultipartFile( + file: file, + data: data, + link: link, + fileKey: 'image', + filename: '${box.read(BoxName.driverID)}.jpg', + methodLabel: 'uploadNewCar', ); - data.forEach((key, value) { - request.fields[key] = value; - }); - - var myrequest = await request.send(); - var res = await http.Response.fromStream(myrequest); - Log.print('uploadNewCar response [${res.statusCode}]: ${res.body}'); - if (res.statusCode == 200) { - return jsonDecode(res.body); - } else { - throw Exception('Failed to upload image: ${res.statusCode} - ${res.body}'); - } } choosImagePicture(String link, String imageType) async { final pickedImage = await picker.pickImage( source: ImageSource.gallery, - // preferredCameraDevice: CameraDevice.rear, - // maxHeight: Get.height * .3, - // maxWidth: Get.width * .9, - // imageQuality: 100, ); image = File(pickedImage!.path); @@ -400,8 +421,7 @@ class ImageController extends GetxController { myImage = File(pickedImage.path); isloading = true; update(); -// Save the cropped image - // File savedCroppedImage = File(croppedFile!.path); + File compressedImage = await compressImage(File(croppedFile!.path)); print('link =$link'); try { @@ -411,7 +431,6 @@ class ImageController extends GetxController { link, ); - // Save the returned URL from the V3 backend to local storage if (response != null && response['status'] == 'success' && response['message'] != null) { if (response['message']['file_link'] != null) { box.write(BoxName.driverPhotoUrl, response['message']['file_link'].toString()); @@ -427,37 +446,14 @@ class ImageController extends GetxController { } uploadImagePicture(File file, Map data, String link) async { - final String token = r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]; - final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? ''; - - var request = http.MultipartRequest('POST', Uri.parse(link)); - request.headers.addAll({ - 'Authorization': 'Bearer $token', - 'X-Device-FP': fingerPrint, - }); - - var length = await file.length(); - var stream = http.ByteStream(file.openRead()); - request.files.add( - http.MultipartFile( - 'image', - stream, - length, - filename: '${box.read(BoxName.driverID)}.jpg', - ), + return _uploadMultipartFile( + file: file, + data: data, + link: link, + fileKey: 'image', + filename: '${box.read(BoxName.driverID)}.jpg', + methodLabel: 'uploadImagePicture', ); - data.forEach((key, value) { - request.fields[key] = value; - }); - - var myrequest = await request.send(); - var res = await http.Response.fromStream(myrequest); - Log.print('uploadImagePicture response [${res.statusCode}]: ${res.body}'); - if (res.statusCode == 200) { - return jsonDecode(res.body); - } else { - throw Exception('Failed to upload image: ${res.statusCode} - ${res.body}'); - } } } diff --git a/siro_driver/lib/views/auth/captin/login_captin.dart b/siro_driver/lib/views/auth/captin/login_captin.dart index 21be57b..57c6083 100755 --- a/siro_driver/lib/views/auth/captin/login_captin.dart +++ b/siro_driver/lib/views/auth/captin/login_captin.dart @@ -15,7 +15,6 @@ import '../../../constant/links.dart'; import '../../../constant/style.dart'; import '../../../controller/auth/apple_sigin.dart'; import '../../../controller/auth/captin/login_captin_controller.dart'; -import '../../../controller/auth/google_sign.dart'; import '../../../main.dart'; import '../../../print.dart'; import '../../widgets/elevated_btn.dart'; @@ -300,14 +299,6 @@ class _LoginCaptinState extends State with WidgetsBindingObserver { style: AppStyle.title, ), const SizedBox(height: 24), - _buildSocialButton( - text: 'Sign In with Google'.tr, - icon: FontAwesome.google, - backgroundColor: AppColor.redColor, - onPressed: () async { - GoogleSignInHelper().signInFromLogin(); - }, - ), if (Platform.isIOS) ...[ const SizedBox(height: 16), _buildSocialButton( diff --git a/siro_driver/lib/views/auth/captin/register_captin.dart b/siro_driver/lib/views/auth/captin/register_captin.dart index 14142bf..db053c7 100755 --- a/siro_driver/lib/views/auth/captin/register_captin.dart +++ b/siro_driver/lib/views/auth/captin/register_captin.dart @@ -6,7 +6,6 @@ import 'package:siro_driver/views/widgets/elevated_btn.dart'; import 'package:siro_driver/views/widgets/my_scafold.dart'; import '../../../constant/colors.dart'; -import '../../../controller/auth/google_sign.dart'; class RegisterCaptin extends StatelessWidget { const RegisterCaptin({super.key}); @@ -178,21 +177,7 @@ class RegisterCaptin extends StatelessWidget { decoration: AppStyle.boxDecoration1, height: Get.height * .3, width: Get.width * .8, - child: Center( - child: Text( - 'Sign in with Google for easier email and name entry'.tr, - textAlign: TextAlign.center, - style: AppStyle.title, - ), - ), - ), - MyElevatedButton( - title: 'Sign In by Google'.tr, - onPressed: () async { - // await GoogleSignInHelper.signIn(); - }, - kolor: AppColor.blueColor, - ), + ) ], ), )) diff --git a/siro_driver/lib/views/auth/syria/registration_view.dart b/siro_driver/lib/views/auth/syria/registration_view.dart index 8094b39..6c2b576 100644 --- a/siro_driver/lib/views/auth/syria/registration_view.dart +++ b/siro_driver/lib/views/auth/syria/registration_view.dart @@ -2,7 +2,9 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import '../../../constant/box_name.dart'; import '../../../controller/auth/syria/registration_controller.dart'; +import '../../../main.dart'; class RegistrationView extends StatelessWidget { const RegistrationView({Key? key}) : super(key: key); @@ -367,32 +369,47 @@ class RegistrationView extends StatelessWidget { const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), const SizedBox(height: 20), _buildImagePickerBox( - 'Driver License (Front)'.tr, - ctrl.docUrls['driver_license_front'], - // () => ctrl.pickImage(ImageType.driverLicenseFront), - - () async => - await ctrl.choosImage(linkUpload, 'driver_license_front'), + 'National ID (Front)'.tr, + ctrl.docUrls['id_front'], + () async => await ctrl.choosImage(linkUpload, 'id_front'), ), _buildImagePickerBox( - 'Driver License (Back)'.tr, - ctrl.docUrls['driver_license_back'], - () async => - await ctrl.choosImage(linkUpload, 'driver_license_back'), - // () => ctrl.pickImage(ImageType.driverLicenseBack), + 'National ID (Back)'.tr, + ctrl.docUrls['id_back'], + () async => await ctrl.choosImage(linkUpload, 'id_back'), + ), + _buildImagePickerBox( + 'Driver License (Front)'.tr, + ctrl.docUrls['driver_license'], + () async => await ctrl.choosImage(linkUpload, 'driver_license'), + ), + if (box.read(BoxName.countryCode) == 'Syria') + _buildImagePickerBox( + 'Driver License (Back)'.tr, + ctrl.docUrls['driver_license_back'], + () async => + await ctrl.choosImage(linkUpload, 'driver_license_back'), + ), + _buildImagePickerBox( + 'Profile Picture'.tr, + ctrl.docUrls['profile_picture'], + () async => await ctrl.choosImage(linkUpload, 'profile_picture'), + ), + _buildImagePickerBox( + ctrl.getCriminalRecordTitle(), + ctrl.docUrls['criminal_record'], + () async => await ctrl.choosImage(linkUpload, 'criminal_record'), ), _buildImagePickerBox( 'Car Registration (Front)'.tr, ctrl.docUrls['car_license_front'], () async => await ctrl.choosImage(linkUpload, 'car_license_front'), - // () => ctrl.pickImage(ImageType.carLicenseFront), ), _buildImagePickerBox( 'Car Registration (Back)'.tr, ctrl.docUrls['car_license_back'], () async => await ctrl.choosImage(linkUpload, 'car_license_back'), - // () => ctrl.pickImage(ImageType.carLicenseBack), ), ], ), diff --git a/siro_driver/macos/Flutter/GeneratedPluginRegistrant.swift b/siro_driver/macos/Flutter/GeneratedPluginRegistrant.swift index 1402229..5893e61 100644 --- a/siro_driver/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/siro_driver/macos/Flutter/GeneratedPluginRegistrant.swift @@ -21,7 +21,6 @@ import flutter_secure_storage_darwin import flutter_tts import flutter_webrtc import geolocator_apple -import google_sign_in_ios import just_audio import local_auth_darwin import location @@ -52,7 +51,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin")) FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) - FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) diff --git a/siro_driver/pubspec.lock b/siro_driver/pubspec.lock index e849bc1..7975e40 100644 --- a/siro_driver/pubspec.lock +++ b/siro_driver/pubspec.lock @@ -1045,14 +1045,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - google_cloud: - dependency: transitive - description: - name: google_cloud - sha256: b385e20726ef5315d302c5933bfb728103116c5be2d3d17094b01a82da538c1f - url: "https://pub.dev" - source: hosted - version: "0.5.0" google_fonts: dependency: "direct main" description: @@ -1061,62 +1053,6 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.0" - google_identity_services_web: - dependency: transitive - description: - name: google_identity_services_web - sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" - url: "https://pub.dev" - source: hosted - version: "0.3.3+1" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: "521031b65853b4409b8213c0387d57edaad7e2a949ce6dea0d8b2afc9cb29763" - url: "https://pub.dev" - source: hosted - version: "7.2.0" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: df5c15533814ed20b7d9e1c5a40a73f174e5d5017bd2669b1c72fb6596fde812 - url: "https://pub.dev" - source: hosted - version: "7.2.11" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: ac1e4c1205267cb7999d1d81333fccffdfda29e853f434bbaf71525498bb6950 - url: "https://pub.dev" - source: hosted - version: "6.3.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: "7f59208c42b415a3cca203571128d6f84f885fead2d5b53eb65a9e27f2965bb5" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: d473003eeca892f96a01a64fc803378be765071cb0c265ee872c7f8683245d14 - url: "https://pub.dev" - source: hosted - version: "1.1.3" - googleapis_auth: - dependency: "direct main" - description: - name: googleapis_auth - sha256: "2a8895c3885197f96bb2fd91ee0ae77b53ff3874c7b1f1eadb6566248e880958" - url: "https://pub.dev" - source: hosted - version: "2.3.1" graphs: dependency: transitive description: diff --git a/siro_driver/pubspec.yaml b/siro_driver/pubspec.yaml index fb94a30..a5f7bcf 100644 --- a/siro_driver/pubspec.yaml +++ b/siro_driver/pubspec.yaml @@ -57,8 +57,6 @@ dependencies: flutter_overlay_window: ^0.5.0 flutter_tts: ^4.0.2 geolocator: ^14.0.2 - google_sign_in: ^7.2.0 - googleapis_auth: ^2.0.0 image_cropper: ^12.1.1 image_picker: ^1.0.4 internet_connection_checker: ^3.0.1 diff --git a/siro_rider/lib/constant/links.dart b/siro_rider/lib/constant/links.dart index e6213a3..33f9d64 100644 --- a/siro_rider/lib/constant/links.dart +++ b/siro_rider/lib/constant/links.dart @@ -3,54 +3,108 @@ import 'package:siro_rider/main.dart'; class AppLink { static const String appDomain = 'siromove.com'; - ///https://walletintaleq.intaleq.xyz/v1/main -static String get paymentServer => 'https://walletintaleq.intaleq.xyz/v2/main'; - - ///https://api.intaleq.xyz/siro/ride/location -static String get location => 'https://api.intaleq.xyz/siro_v3/ride/location'; - - /// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات. - /// https://routesy.intaleq.xyz for syria - /// for jordan https://routesjo.intaleq.xyz -static String get routesOsm => 'https://routesy.intaleq.xyz'; -static String get mapSaasRoute => 'https://map-saas.intaleqapp.com/api/maps/route'; -static String get reverseGeocoding => - 'https://map-saas.intaleqapp.com/api/geocoding/reverse'; -static String get searchGeocoding => - 'https://map-saas.intaleqapp.com/api/geocoding/search'; -static String get mapSaasPlaces => - 'https://map-saas.intaleqapp.com/api/geocoding/places'; - - ///https://location.intaleq.xyz/siro/ride/location - ///locationServerSide هو السيرفر الجانبي الخاص بموقع السائقين، حيث يتم إرسال تحديثات الموقع من التطبيق إلى هذا السيرفر، ومن ثم يقوم هذا السيرفر بتوزيع هذه التحديثات إلى الركاب المتصلين الذين يتابعون السائق في الوقت الحقيقي. -static String get locationServerSide => - 'https://location.intaleq.xyz/siro/ride/location'; - static String get currentCountry => box.read(BoxName.countryCode) ?? 'Jordan'; - ///https://api.intaleq.xyz/siro - static String get endPoint => server; - - /// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات. - /// https://rides.intaleq.xyz/siro - static String get rideServerSide => 'https://rides.intaleq.xyz/siro'; - - /// main api link for all api calls except rides and location - static String get server { + static String get paymentServer { switch (currentCountry) { - case 'Syria': - return 'https://api-syria.siromove.com/siro_v3'; - case 'Egypt': - return 'https://api-egypt.siromove.com/siro_v3'; - case 'Jordan': - default: - return 'https://api-jordan.siromove.com/siro_v3'; + case 'Syria': return 'https://wallet-syria.siromove.com/v1/main'; + case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; + case 'Jordan': return 'https://wallet-jordan.siromove.com/v1/main'; + default: return 'https://wallet.siromove.com/v1/main'; } } - ///https://rides.intaleq.xyz - /// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات. -static String get serverSocket => 'https://rides.intaleq.xyz'; + static String get location { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro_v3/ride/location'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro_v3/ride/location'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro_v3/ride/location'; + default: return 'https://api.siromove.com/siro_v3/ride/location'; + } + } + + static String get locationServerSide { + switch (currentCountry) { + case 'Syria': return 'https://location-syria.siromove.com/siro/ride/location'; + case 'Egypt': return 'https://location-egypt.siromove.com/siro/ride/location'; + case 'Jordan': return 'https://location-jordan.siromove.com/siro/ride/location'; + default: return 'https://location.siromove.com/siro/ride/location'; + } + } + + static String get routesOsm { + switch (currentCountry) { + case 'Syria': return 'https://routes-syria.siromove.com'; + case 'Egypt': return 'https://routes-egypt.siromove.com'; + case 'Jordan': return 'https://routes-jordan.siromove.com'; + default: return 'https://routes.siromove.com'; + } + } + + static String get mapSaasRoute { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/maps/route'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/maps/route'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/maps/route'; + default: return 'https://map-saas.intaleqapp.com/api/maps/route'; + } + } + + static String get reverseGeocoding { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/reverse'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/reverse'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/reverse'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/reverse'; + } + } + + static String get searchGeocoding { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/search'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/search'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/search'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/search'; + } + } + + static String get mapSaasPlaces { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/places'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/places'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/places'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/places'; + } + } + + static String get endPoint => server; + + static String get rideServerSide { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro'; + default: return 'https://api.siromove.com/siro'; + } + } + + static String get server { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro_v3'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro_v3'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro_v3'; + default: return 'https://api.siromove.com/siro_v3'; + } + } + + static String get serverSocket { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com'; + case 'Egypt': return 'https://api-egypt.siromove.com'; + case 'Jordan': return 'https://api-jordan.siromove.com'; + default: return 'https://api.siromove.com'; + } + } /// static String get googleMapsLink => 'https://maps.googleapis.com/maps/api/'; diff --git a/siro_rider/lib/controller/auth/google_sign.dart b/siro_rider/lib/controller/auth/google_sign.dart deleted file mode 100644 index 72d058d..0000000 --- a/siro_rider/lib/controller/auth/google_sign.dart +++ /dev/null @@ -1,149 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:get/get.dart'; -import 'package:google_sign_in/google_sign_in.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import '../../constant/box_name.dart'; -import '../../constant/links.dart'; -import '../../main.dart'; -import '../../print.dart'; -import '../functions/crud.dart'; -import '../../onbording_page.dart'; -import 'login_controller.dart'; - -class GoogleSignInHelper { - // ✅ GoogleSignIn singleton - static final GoogleSignIn _signIn = GoogleSignIn.instance; - - static GoogleSignInAccount? _lastUser; - - /// 👇 استدعها في main() مرة واحدة - static Future init() async { - await _signIn.initialize( - serverClientId: - '594687661098-2u640akrb3k7sak5t0nqki6f4v6hq1bq.apps.googleusercontent.com', - ); - - // Events listener - _signIn.authenticationEvents.listen((event) async { - if (event is GoogleSignInAuthenticationEventSignIn) { - _lastUser = event.user; - await _handleSignUp(event.user); - } else if (event is GoogleSignInAuthenticationEventSignOut) { - _lastUser = null; - } - }); - - // silent login if possible - try { - await _signIn.attemptLightweightAuthentication(); - } catch (e) { - Log.print("Error: $e"); - } - } - - /// ✅ تسجيل دخول عادي - static Future signIn() async { - try { - final user = - await _signIn.authenticate(scopeHint: const ['email', 'profile']); - _lastUser = user; - await _handleSignUp(user); - - // اطبع القيم (للتأكد) - Log.print("Google ID: ${user.id}"); - Log.print("Email: ${user.email}"); - Log.print("Name: ${user.displayName}"); - Log.print("Photo: ${user.photoUrl}"); - return user; - } on PlatformException catch (e) { - if (e.code == 'sign_in_required') { - await showGooglePlayServicesError(); - } - return null; - } catch (e) { - await addError("Google Sign-In error: $e", "signIn()"); - return null; - } - } - - /// ✅ تسجيل دخول مخصص لشاشة Login (مع استدعاء الكنترولر) - static Future signInFromLogin() async { - await init(); - final user = await signIn(); - if (user != null) { - await Get.put(LoginController()).loginUsingCredentials( - box.read(BoxName.passengerID).toString(), - box.read(BoxName.email).toString(), - ); - } - return user; - } - - /// ✅ طلب سكوبات إضافية (بديل withScopes القديم) - static Future requestExtraScopes(List scopes) async { - final user = _lastUser; - if (user == null) return; - await user.authorizationClient.authorizeScopes(scopes); - } - - /// ✅ تسجيل خروج - static Future signOut() async { - await _signIn.signOut(); - await _handleSignOut(); - } - - static GoogleSignInAccount? getCurrentUser() => _lastUser; - - // ================= Helpers ================== - - static Future _handleSignUp(GoogleSignInAccount user) async { - box.write(BoxName.passengerID, user.id); - box.write(BoxName.email, user.email); - box.write(BoxName.name, user.displayName ?? ''); - box.write(BoxName.passengerPhotoUrl, user.photoUrl ?? ''); - } - - static Future _handleSignOut() async { - box.erase(); - - Get.offAll(OnBoardingPage()); - } - - static Future addError(String error, String where) async { - await CRUD().post(link: AppLink.addError, payload: { - 'error': error, - 'userId': box.read(BoxName.driverID) ?? box.read(BoxName.passengerID), - 'userType': box.read(BoxName.driverID) != null ? 'Driver' : 'Passenger', - 'phone': box.read(BoxName.phone) ?? box.read(BoxName.phoneDriver), - 'device': where, - }); - } - - static Future showGooglePlayServicesError() async { - const playStoreUrl = - 'https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en_US'; - final uri = Uri.parse(playStoreUrl); - if (await canLaunchUrl(uri)) { - await launchUrl(uri); - } else { - showDialog( - context: Get.context!, - builder: (context) => AlertDialog( - title: Text('Error'.tr), - content: Text( - 'Could not open the Google Play Store. Please update Google Play Services manually.' - .tr, - ), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: Text('Close'.tr), - ), - ], - ), - ); - } - } -} diff --git a/siro_rider/lib/controller/firebase/access_token.dart b/siro_rider/lib/controller/firebase/access_token.dart index 93c6898..58aa072 100644 --- a/siro_rider/lib/controller/firebase/access_token.dart +++ b/siro_rider/lib/controller/firebase/access_token.dart @@ -1,50 +1,50 @@ -import 'dart:convert'; -import 'package:googleapis_auth/auth_io.dart'; +// import 'dart:convert'; +// import 'package:googleapis_auth/auth_io.dart'; -class AccessTokenManager { - static final AccessTokenManager _instance = AccessTokenManager._internal(); - late final String serviceAccountJsonKey; - AccessToken? _accessToken; - DateTime? _expiryDate; +// class AccessTokenManager { +// static final AccessTokenManager _instance = AccessTokenManager._internal(); +// late final String serviceAccountJsonKey; +// AccessToken? _accessToken; +// DateTime? _expiryDate; - AccessTokenManager._internal(); +// AccessTokenManager._internal(); - factory AccessTokenManager(String jsonKey) { - if (_instance._isServiceAccountKeyInitialized()) { - // Prevent re-initialization - return _instance; - } - _instance.serviceAccountJsonKey = jsonKey; - return _instance; - } +// factory AccessTokenManager(String jsonKey) { +// if (_instance._isServiceAccountKeyInitialized()) { +// // Prevent re-initialization +// return _instance; +// } +// _instance.serviceAccountJsonKey = jsonKey; +// return _instance; +// } - bool _isServiceAccountKeyInitialized() { - try { - serviceAccountJsonKey; // Access to check if initialized - return true; - } catch (e) { - return false; - } - } +// bool _isServiceAccountKeyInitialized() { +// try { +// serviceAccountJsonKey; // Access to check if initialized +// return true; +// } catch (e) { +// return false; +// } +// } - Future getAccessToken() async { - if (_accessToken != null && DateTime.now().isBefore(_expiryDate!)) { - return _accessToken!.data; - } - try { - final serviceAccountCredentials = ServiceAccountCredentials.fromJson( - json.decode(serviceAccountJsonKey)); - final client = await clientViaServiceAccount( - serviceAccountCredentials, - ['https://www.googleapis.com/auth/firebase.messaging'], - ); +// Future getAccessToken() async { +// if (_accessToken != null && DateTime.now().isBefore(_expiryDate!)) { +// return _accessToken!.data; +// } +// try { +// final serviceAccountCredentials = ServiceAccountCredentials.fromJson( +// json.decode(serviceAccountJsonKey)); +// final client = await clientViaServiceAccount( +// serviceAccountCredentials, +// ['https://www.googleapis.com/auth/firebase.messaging'], +// ); - _accessToken = client.credentials.accessToken; - _expiryDate = client.credentials.accessToken.expiry; - client.close(); - return _accessToken!.data; - } catch (e) { - throw Exception('Failed to obtain access token'); - } - } -} +// _accessToken = client.credentials.accessToken; +// _expiryDate = client.credentials.accessToken.expiry; +// client.close(); +// return _accessToken!.data; +// } catch (e) { +// throw Exception('Failed to obtain access token'); +// } +// } +// } diff --git a/siro_rider/lib/controller/firebase/firbase_messge.dart b/siro_rider/lib/controller/firebase/firbase_messge.dart index 8d9f999..565a4ab 100644 --- a/siro_rider/lib/controller/firebase/firbase_messge.dart +++ b/siro_rider/lib/controller/firebase/firbase_messge.dart @@ -15,7 +15,6 @@ import '../../print.dart'; import '../../views/Rate/rate_captain.dart'; import '../../views/home/map_page_passenger.dart'; import '../../views/home/profile/promos_passenger_page.dart'; -import '../auth/google_sign.dart'; import 'package:siro_rider/controller/voice_call_controller.dart'; import '../home/map/ride_lifecycle_controller.dart'; import '../home/map/ride_state.dart'; @@ -159,7 +158,7 @@ class FirebaseMessagesController extends GetxController { if (Platform.isAndroid) { notificationController.showNotification(title, body, 'cancel'); } - GoogleSignInHelper.signOut(); + box.remove(BoxName.jwt); } else if (category == 'Driver Is Going To Passenger') { // <-- كان 'Driver Is Going To Passenger' Get.find().isDriverInPassengerWay = true; @@ -253,9 +252,7 @@ class FirebaseMessagesController extends GetxController { rideIdVal: rideId.toString(), ); } - } - - else if (category == 'Order Applied') { + } else if (category == 'Order Applied') { if (Platform.isAndroid) { notificationController.showNotification( 'The order Accepted by another Driver'.tr, @@ -317,7 +314,7 @@ class FirebaseMessagesController extends GetxController { // notificationController.showNotification( // 'token change'.tr, 'token change'.tr, 'cancel'); // } - // GoogleSignInHelper.signOut(); + // // GoogleSignInHelper.signOut(); // } else if (message.notification!.title! == 'Driver Is Going To Passenger') { // Get.find().isDriverInPassengerWay = true; // Get.find().update(); diff --git a/siro_rider/lib/controller/firebase/notification_service.dart b/siro_rider/lib/controller/firebase/notification_service.dart index cb44217..8c70e17 100644 --- a/siro_rider/lib/controller/firebase/notification_service.dart +++ b/siro_rider/lib/controller/firebase/notification_service.dart @@ -1,12 +1,12 @@ import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:get/get.dart'; +import '../../constant/links.dart'; import '../../print.dart'; // للترجمة .tr class NotificationService { - static const String _serverUrl = - 'https://api.intaleq.xyz/siro/ride/firebase/send_fcm.php'; + static String get _serverUrl => '${AppLink.server}/ride/firebase/send_fcm.php'; static Future sendNotification({ required String target, diff --git a/siro_rider/macos/Flutter/GeneratedPluginRegistrant.swift b/siro_rider/macos/Flutter/GeneratedPluginRegistrant.swift index 5c02189..099eacc 100644 --- a/siro_rider/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/siro_rider/macos/Flutter/GeneratedPluginRegistrant.swift @@ -19,7 +19,6 @@ import flutter_secure_storage_darwin import flutter_tts import flutter_webrtc import geolocator_apple -import google_sign_in_ios import just_audio import local_auth_darwin import location @@ -49,7 +48,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin")) FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) - FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) diff --git a/siro_rider/pubspec.lock b/siro_rider/pubspec.lock index b4624b9..73284d3 100644 --- a/siro_rider/pubspec.lock +++ b/siro_rider/pubspec.lock @@ -885,14 +885,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - google_cloud: - dependency: transitive - description: - name: google_cloud - sha256: b385e20726ef5315d302c5933bfb728103116c5be2d3d17094b01a82da538c1f - url: "https://pub.dev" - source: hosted - version: "0.5.0" google_fonts: dependency: "direct main" description: @@ -901,62 +893,6 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.0" - google_identity_services_web: - dependency: transitive - description: - name: google_identity_services_web - sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" - url: "https://pub.dev" - source: hosted - version: "0.3.3+1" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: "521031b65853b4409b8213c0387d57edaad7e2a949ce6dea0d8b2afc9cb29763" - url: "https://pub.dev" - source: hosted - version: "7.2.0" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: df5c15533814ed20b7d9e1c5a40a73f174e5d5017bd2669b1c72fb6596fde812 - url: "https://pub.dev" - source: hosted - version: "7.2.11" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: ac1e4c1205267cb7999d1d81333fccffdfda29e853f434bbaf71525498bb6950 - url: "https://pub.dev" - source: hosted - version: "6.3.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: "7f59208c42b415a3cca203571128d6f84f885fead2d5b53eb65a9e27f2965bb5" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: d473003eeca892f96a01a64fc803378be765071cb0c265ee872c7f8683245d14 - url: "https://pub.dev" - source: hosted - version: "1.1.3" - googleapis_auth: - dependency: "direct main" - description: - name: googleapis_auth - sha256: "2a8895c3885197f96bb2fd91ee0ae77b53ff3874c7b1f1eadb6566248e880958" - url: "https://pub.dev" - source: hosted - version: "2.3.1" graphs: dependency: transitive description: diff --git a/siro_rider/pubspec.yaml b/siro_rider/pubspec.yaml index 444df42..f002941 100644 --- a/siro_rider/pubspec.yaml +++ b/siro_rider/pubspec.yaml @@ -59,12 +59,10 @@ dependencies: webview_flutter_wkwebview: ^3.14.0 just_audio: ^0.10.5 # share: ^2.0.4 - google_sign_in: ^7.2.0 sign_in_with_apple: ^7.0.1 firebase_auth: ^6.1.4 device_info_plus: ^12.1.0 # uni_links: ^0.5.1 - googleapis_auth: ^2.0.0 flutter_confetti: ^0.5.1 # intl_phone_field: ^3.1.0 flutter_contacts: ^1.1.9+2 diff --git a/siro_service/lib/constant/links.dart b/siro_service/lib/constant/links.dart index 50a9479..26d5db9 100644 --- a/siro_service/lib/constant/links.dart +++ b/siro_service/lib/constant/links.dart @@ -9,22 +9,80 @@ class AppLink { static final String seferAlexandriaServer = Env.seferAlexandriaServer; static final String seferCairoServer = Env.seferCairoServer; static final String seferGizaServer = Env.seferGizaServer; - static String paymentServer = 'https://walletintaleq.intaleq.xyz/v1/main'; - static String locationServer = 'https://location.intaleq.xyz/siro/ride/location'; - static String location = locationServer; - static String locationServerSide = 'https://location.intaleq.xyz/siro/ride/location'; - static String mapSaasRoute = 'https://map-saas.intaleqapp.com/api/maps/route'; - static String mapSaasPlaces = 'https://map-saas.intaleqapp.com/api/geocoding/places'; - static const String routeApiBaseUrl = "https://routesjo.intaleq.xyz/route/v1/driving"; - static final String syria = 'https://syria.intaleq.xyz/siro'; + static String get currentCountry => box.read('countryCode') ?? 'Jordan'; + + static String get paymentServer { + switch (currentCountry) { + case 'Syria': return 'https://wallet-syria.siromove.com/v1/main'; + case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; + case 'Jordan': return 'https://wallet-jordan.siromove.com/v1/main'; + default: return 'https://wallet.siromove.com/v1/main'; + } + } + + static String get locationServer { + switch (currentCountry) { + case 'Syria': return 'https://location-syria.siromove.com/siro/ride/location'; + case 'Egypt': return 'https://location-egypt.siromove.com/siro/ride/location'; + case 'Jordan': return 'https://location-jordan.siromove.com/siro/ride/location'; + default: return 'https://location.siromove.com/siro/ride/location'; + } + } + + static String get location => locationServer; + static String get locationServerSide => locationServer; + + static String get mapSaasRoute { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/maps/route'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/maps/route'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/maps/route'; + default: return 'https://map-saas.intaleqapp.com/api/maps/route'; + } + } + + static String get mapSaasPlaces { + switch (currentCountry) { + case 'Syria': return 'https://map-syria.siromove.com/api/geocoding/places'; + case 'Egypt': return 'https://map-egypt.siromove.com/api/geocoding/places'; + case 'Jordan': return 'https://map-jordan.siromove.com/api/geocoding/places'; + default: return 'https://map-saas.intaleqapp.com/api/geocoding/places'; + } + } + + static String get routeApiBaseUrl { + switch (currentCountry) { + case 'Syria': return 'https://routes-syria.siromove.com/route/v1/driving'; + case 'Egypt': return 'https://routes-egypt.siromove.com/route/v1/driving'; + case 'Jordan': return 'https://routes-jordan.siromove.com/route/v1/driving'; + default: return 'https://routes.siromove.com/route/v1/driving'; + } + } + + static String get syria => 'https://api-syria.siromove.com/siro'; static String seferPaymentServer0 = box.read('seferPaymentServer'); - static final String endPoint = 'https://api.intaleq.xyz/siro_v3'; - static final String rideServer = 'https://rides.intaleq.xyz/siro'; - // static final String server = Env.serverPHP; - static String getBestDriver = "$server/Admin/driver/getBestDriver.php"; - static final String server = 'https://api.intaleq.xyz/siro_v3'; + static String get endPoint { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro_v3'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro_v3'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro_v3'; + default: return 'https://api.siromove.com/siro_v3'; + } + } + + static String get rideServer { + switch (currentCountry) { + case 'Syria': return 'https://api-syria.siromove.com/siro'; + case 'Egypt': return 'https://api-egypt.siromove.com/siro'; + case 'Jordan': return 'https://api-jordan.siromove.com/siro'; + default: return 'https://api.siromove.com/siro'; + } + } + + static String get getBestDriver => "$server/Admin/driver/getBestDriver.php"; + static String get server => endPoint; static final String jwtService = '$server/jwtService.php'; static String addError = "$server/Admin/errorApp.php"; diff --git a/siro_service/macos/Flutter/GeneratedPluginRegistrant.swift b/siro_service/macos/Flutter/GeneratedPluginRegistrant.swift index d845562..f57a7f0 100644 --- a/siro_service/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/siro_service/macos/Flutter/GeneratedPluginRegistrant.swift @@ -13,7 +13,6 @@ import firebase_messaging import flutter_image_compress_macos import flutter_local_notifications import flutter_secure_storage_macos -import google_sign_in_ios import share_plus import sqflite_darwin import url_launcher_macos @@ -27,7 +26,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) - FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/siro_service/pubspec.lock b/siro_service/pubspec.lock index fc6ab67..d187bd7 100644 --- a/siro_service/pubspec.lock +++ b/siro_service/pubspec.lock @@ -600,54 +600,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.3.3" - google_identity_services_web: - dependency: transitive - description: - name: google_identity_services_web - sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" - url: "https://pub.dev" - source: hosted - version: "0.3.3+1" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: "521031b65853b4409b8213c0387d57edaad7e2a949ce6dea0d8b2afc9cb29763" - url: "https://pub.dev" - source: hosted - version: "7.2.0" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: df5c15533814ed20b7d9e1c5a40a73f174e5d5017bd2669b1c72fb6596fde812 - url: "https://pub.dev" - source: hosted - version: "7.2.11" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: ac1e4c1205267cb7999d1d81333fccffdfda29e853f434bbaf71525498bb6950 - url: "https://pub.dev" - source: hosted - version: "6.3.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: "7f59208c42b415a3cca203571128d6f84f885fead2d5b53eb65a9e27f2965bb5" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: d473003eeca892f96a01a64fc803378be765071cb0c265ee872c7f8683245d14 - url: "https://pub.dev" - source: hosted - version: "1.1.3" graphs: dependency: transitive description: diff --git a/siro_service/pubspec.yaml b/siro_service/pubspec.yaml index e84e7f6..077b4b8 100644 --- a/siro_service/pubspec.yaml +++ b/siro_service/pubspec.yaml @@ -49,7 +49,6 @@ dependencies: url_launcher: ^6.3.0 flutter_launcher_icons: ^0.14.3 envied: ^1.1.1 - google_sign_in: ^7.1.1 firebase_auth: ^6.0.0 vibration: ^3.1.3 flutter_secure_storage: ^9.2.2