Changeset 942028f in Klonkt


Ignore:
Timestamp:
06/14/2026 04:01:38 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
2b52bfb
Parents:
9b36f45
Message:

app: remove APK/TWA variant — PWA-only install

Robin: only PWA possible, no APK. Removed:

  • src/assets/apk/soundfabrics.apk + src/assets/.well-known/assetlinks.json
  • /.well-known/assetlinks.json route (server.js) — only needed for TWA
  • data-apk-url on the install button (footer.ejs)
  • the 'Option B — APK' branch + Option A/B framing in install-app.js (now PWA-only)

install-app.js?v bump (without cache buster the old version would keep
being served).

Co-Authored-By: Claude <noreply@…>

Location:
src
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/assets/js/install-app.js

    r9b36f45 r942028f  
    77 *  - On click, opens a modal with platform-specific instructions:
    88 *      iOS     → "Voeg toe aan beginscherm" via Safari share sheet
    9  *      Android → choice between PWA install (1-tap if available) and APK download
     9 *      Android → PWA install (1-tap if available, else Chrome ⋮-menu instructions)
    1010 *      Desktop → instructions for Chrome/Edge install icon, or native prompt if available
    1111 *  - Listens for `beforeinstallprompt` (Android Chrome / desktop Chromium) and
    1212 *    deferreds it so the modal's "Install as PWA" button can fire it.
    1313 *
    14  * Markup contract: <button data-pcms-install-app data-apk-url="/path/to.apk">
     14 * Markup contract: <button data-pcms-install-app>
    1515 *
    1616 * CSS: .install-app-btn / .install-modal* / .install-choice* — defined in
     
    3030  const isIOS     = /iPad|iPhone|iPod/.test(ua) && !window.MSStream;
    3131  const isAndroid = /Android/.test(ua);
    32   const apkUrl    = btn.dataset.apkUrl || '';
    3332
    3433  // Capture Chrome/Edge native install prompt so we can fire it from our modal.
     
    10099      : `<p class="install-choice-note">Open deze site in <strong>Chrome</strong> en kies in het <strong>⋮-menu → "App installeren"</strong> (of "Aan beginscherm toevoegen").</p>`;
    101100
    102     const apkBlock = apkUrl ? `
    103       <div class="install-choice install-choice-apk">
    104         <h4>🤖 Optie B — APK (native Android-app)</h4>
    105         <div class="install-pros-cons">
    106           <div class="install-pros">
    107             <strong>Voordelen</strong>
    108             <ul>
    109               <li>Echte app in app-lade, naast WhatsApp/Gmail</li>
    110               <li>Beste achtergrond-audio ondersteuning</li>
    111               <li>Lock-screen controls werken optimaal</li>
    112               <li>Blijft geïnstalleerd ongeacht browser-cache</li>
    113             </ul>
    114           </div>
    115           <div class="install-cons">
    116             <strong>Nadelen</strong>
    117             <ul>
    118               <li>Moet eenmalig "onbekende bronnen" toestaan</li>
    119               <li>Geen auto-updates — nieuwe versie = APK opnieuw downloaden</li>
    120               <li>Browser toont beveiligings-waarschuwing bij install</li>
    121               <li>Alleen Android (Android 5+ / API 21+)</li>
    122             </ul>
    123           </div>
    124         </div>
    125         <a href="${apkUrl}" class="install-choice-cta" download>
    126           <svg width="18" height="18" viewBox="0 0 24 24" style="vertical-align:middle;margin-right:.35rem"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z" fill="currentColor"/></svg>
    127           Download APK
    128         </a>
    129         <ol class="install-steps" style="margin-top:.75rem">
    130           <li>Tik op de gedownloade APK</li>
    131           <li>Sta eenmalig <strong>"installeren van onbekende bronnen"</strong> toe voor je browser</li>
    132           <li>Tik <strong>Installeer</strong> in de popup</li>
    133           <li>Open de app vanuit je app-lade</li>
    134         </ol>
    135       </div>
    136     ` : '';
    137 
    138101    showModal(`
    139102      <h3 id="install-title" style="margin:0 0 .5rem">🤖 Installeer op Android</h3>
    140       <p style="margin:0 0 1.25rem;opacity:.8">Twee manieren. Kies wat bij je past:</p>
    141 
    142       <div class="install-choice install-choice-pwa">
    143         <h4>📱 Optie A — Home-screen shortcut (PWA)</h4>
    144         <div class="install-pros-cons">
    145           <div class="install-pros">
    146             <strong>Voordelen</strong>
    147             <ul>
    148               <li>Instant — geen download of toestemmingen</li>
    149               <li>Updates automatisch bij elke site-wijziging</li>
    150               <li>Geen beveiligings-waarschuwing</li>
    151               <li>Minder opslagruimte op je telefoon</li>
    152             </ul>
    153           </div>
    154           <div class="install-cons">
    155             <strong>Nadelen</strong>
    156             <ul>
    157               <li>Vereist Chrome als browser</li>
    158               <li>Audio-in-achtergrond iets minder robuust dan native</li>
    159               <li>Kan verdwijnen als je browser-data wist</li>
    160             </ul>
    161           </div>
    162         </div>
    163         ${nativeLine}
    164       </div>
    165 
    166       ${apkBlock}
    167 
    168       <p style="margin:1rem 0 0;opacity:.65;font-size:.82rem">💡 Weet je niet wat te kiezen? Begin met <strong>Optie A (shortcut)</strong>. Te beperkt? Ga dan voor de APK.</p>
     103      <p style="margin:0 0 1rem;opacity:.8">Voeg deze site als app toe aan je beginscherm:</p>
     104      <ul class="install-steps" style="opacity:.85">
     105        <li>Instant — geen download of toestemmingen</li>
     106        <li>Updatet automatisch bij elke wijziging</li>
     107        <li>Minder opslag dan een losse app</li>
     108      </ul>
     109      ${nativeLine}
     110      <p style="margin:1rem 0 0;opacity:.7;font-size:.85rem">⚠️ Werkt het best in Chrome.</p>
    169111    `);
    170112  }
  • src/server.js

    r9b36f45 r942028f  
    118118app.use('/media', express.static(process.env.MEDIA_PATH || './storage/media'));
    119119
    120 // P64 — TWA / digital-asset-links: must be served at /.well-known/assetlinks.json
    121 // at the site root with Content-Type: application/json. Without this Android
    122 // shows the URL bar inside the installed PrutFolio app.
    123 app.get('/.well-known/assetlinks.json', (req, res) => {
    124   res.type('application/json').sendFile(
    125     path.join(__dirname, 'assets', '.well-known', 'assetlinks.json')
    126   );
    127 });
     120// (Verwijderd) TWA / digital-asset-links — alleen nodig voor de APK/TWA-variant.
     121// Klonkt is PWA-only; geen assetlinks.json meer.
    128122
    129123initializeDatabase();
  • src/views/partials/footer.ejs

    r9b36f45 r942028f  
    2020  </div>
    2121
    22   <%# P64 — Install-app button. JS detects platform & opens modal with steps.
    23       data-apk-url is the direct download for Android users who want the
    24       native APK route instead of the PWA. %>
     22  <%# Install-app button. JS detects platform & opens a modal with PWA-install
     23      steps (iOS share-sheet / Android Chrome / desktop). PWA only — geen APK. %>
    2524  <div class="site-footer-install container">
    26     <button type="button" class="install-app-btn" data-pcms-install-app data-apk-url="/assets/apk/soundfabrics.apk">
     25    <button type="button" class="install-app-btn" data-pcms-install-app>
    2726      <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M5 20h14v-2H5v2zm7-18L5.33 9h3.84v6h5.66V9h3.84L12 2z" fill="currentColor"/></svg>
    2827      <span>Installeer app</span>
  • src/views/shell.ejs

    r9b36f45 r942028f  
    283283
    284284<!-- Install-app button: detects platform + shows install instructions modal -->
    285 <script src="/assets/js/install-app.js" defer></script>
     285<script src="/assets/js/install-app.js?v=2" defer></script>
    286286
    287287<!-- Service Worker registration -->
Note: See TracChangeset for help on using the changeset viewer.