require_once __DIR__ . '/config/database.php'; require_once __DIR__ . '/includes/site-icons.php'; $iconVersion = get_site_icon_version(); header('Content-Type: application/json; charset=utf-8'); // Load PWA settings from admin_settings $stmt = db()->query("SELECT setting_key, setting_value FROM admin_settings WHERE setting_key LIKE 'pwa_%'"); $settings = []; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $settings[$row['setting_key']] = $row['setting_value']; } $appName = $settings['pwa_app_name'] ?? 'ExclusiveSexy - Rede Social'; $shortName = $settings['pwa_short_name'] ?? 'ExclusiveSexy'; $themeColor = $settings['pwa_theme_color'] ?? '#0d0f12'; $bgColor = $settings['pwa_background_color'] ?? '#0d0f12'; $manifest = [ 'name' => $appName, 'short_name' => $shortName, 'description' => 'Rede social adulta para encontros e conexões.', 'start_url' => './app.php', 'display' => 'standalone', 'orientation' => 'portrait', 'theme_color' => $themeColor, 'background_color' => $bgColor, 'lang' => 'pt-BR', 'categories' => ['social'], 'icons' => [ [ 'src' => 'assets/img/icon-72.png?v=' . $iconVersion, 'sizes' => '72x72', 'type' => 'image/png' ], [ 'src' => 'assets/img/icon-192.png?v=' . $iconVersion, 'sizes' => '192x192', 'type' => 'image/png', 'purpose' => 'any maskable' ], [ 'src' => 'assets/img/icon-512.png?v=' . $iconVersion, 'sizes' => '512x512', 'type' => 'image/png', 'purpose' => 'any maskable' ] ] ]; echo json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);