<?php
header('Content-Type: application/json');

// Dummy data for the current version of the app. You can replace this with a database query or other logic.
$latestVersionInfo = [
    'com.lemmda.klimodriver' => '1.2.0', // Android package name and latest version
    'com.lemmda.klimodriverios' => '1.2.0' // iOS bundle identifier and latest version
];

// Get the app ID from the request query parameters
$appId = isset($_GET['appId']) ? $_GET['appId'] : '';

if ($appId && isset($latestVersionInfo[$appId])) {
    echo json_encode([
        'success' => true,
        'latestVersion' => $latestVersionInfo[$appId]
    ]);
} else {
    echo json_encode([
        'success' => false,
        'message' => 'App ID not found or not provided.'
    ]);
}

?>
