feat(twa): agregar .well-known/assetlinks.json para verificacion oficial Google Play Android

This commit is contained in:
unknown
2026-10-08 22:55:07 -06:00
parent bf0ddc881d
commit 98f5d1e2a7
7 changed files with 16 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.sibopay.twa",
"sha256_cert_fingerprints": ["A5:ED:D0:0A:24:5F:96:93:15:DE:D9:24:42:BD:43:00:AE:0A:65:5A:B0:88:EA:CC:94:E9:A7:98:C5:23:26:9B"]
}
}]

Before

Width:  |  Height:  |  Size: 620 KiB

After

Width:  |  Height:  |  Size: 620 KiB

Before

Width:  |  Height:  |  Size: 290 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Before

Width:  |  Height:  |  Size: 924 KiB

After

Width:  |  Height:  |  Size: 924 KiB

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 213 KiB

+8 -1
View File
@@ -118,13 +118,20 @@ app.get('/desktop-preview.html', (req, res) => {
res.redirect(301, '/');
});
// Android Digital Asset Links para TWA (Google Play Store)
app.get(['/.well-known/assetlinks.json', '/.well-known/assetlinks'], (req, res) => {
res.setHeader('Content-Type', 'application/json');
res.sendFile(path.join(__dirname, '../public/.well-known/assetlinks.json'));
});
// Servir archivos estáticos con compresión y caché optimizado para PWA
app.use(express.static(path.join(__dirname, '../public'), {
dotfiles: 'allow',
etag: true,
maxAge: '1d',
setHeaders: (res, filePath) => {
// Para HTML y Service Worker: siempre revalidar para garantizar actualizaciones inmediatas
if (filePath.endsWith('.html') || filePath.endsWith('sw.js') || filePath.endsWith('manifest.json')) {
if (filePath.endsWith('.html') || filePath.endsWith('sw.js') || filePath.endsWith('manifest.json') || filePath.includes('assetlinks.json')) {
res.setHeader('Cache-Control', 'no-cache, must-revalidate');
} else {
// Para CSS, JS, imágenes y fuentes: permitir caché con stale-while-revalidate para arranque instantáneo