Dev.to · 4 min read

Skip the App Stores: Build an Installable, Native-Like Mobile App with Angular, Ionic & PWA

Skip the App Stores: Build an Installable, Native-Like Mobile App with Angular, Ionic & PWA

[!NOTE] Summary: Progressive Web Apps (PWAs) combine the reach of the web with the native experience and speed of mobile apps. In this guide, we walk step-by-step through building an installable, native-like mobile app with Angular, Ionic, and PWA capabilities—covering service workers, web manifests, iOS Safari requirements, and instant free deployment. Why Ionic Delivers That Authentic Native-Like Feel Building a web app for mobile is easy, but making it feel native is where most web applications fail. This is where Ionic shines: Native Touch Gestures: Ionic brings built-in mobile gestures—such as swipe-to-go-back, pull-to-refresh (ion-refresher), swipeable modals, and instant touch feedback—directly into the browser. Hardware-Accelerated Animations: Transitions between pages (iOS slide-in, Android material push) run on the Web Animations API at 60fps/120fps with zero jank. Adaptive Platform Styling: Ionic automatically adapts its UI controls—rendering iOS Human Interface Guidelines styling on Apple devices and Material Design on Android devices automatically from a single codebase. Combining Ionic's native UI controls with Angular's PWA capabilities gives your users a mobile app that looks, feels, and responds exactly like an app downloaded from the App Store. 1. Setting Up Angular PWA Support Angular CLI provides an official automated schematic to convert your project into a PWA: npx ng add @angular/pwa What this schematic generates: public/manifest.webmanifest: Configures app name, theme color, display mode (standalone), and app icons. ngsw-config.json: Defines caching strategies for static assets (index, JS, CSS) and dynamic lazy-loaded chunk bundles. src/main.ts: Registers provideServiceWorker(). public/icons/: Generates a standard set of PWA icon assets (72x72 up to 512x512). 2. The manifest.webmanifest Asset Configuration When serving your application with ionic serve or building for production, ensure angular.json maps your static public/ directory so the browser serves manifest.webmanifest cleanly at the root URL. Update angular.json: Add the public/ directory mapping to the "assets" array in angular.json: "options": { "outputPath": { "base": "www", "browser": "" }, "index": "src/index.html", "polyfills": ["src/polyfills.ts"], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ { "glob": "**/*", "input": "public", "output": "." }, { "glob": "**/*", "input": "src/assets", "output": "assets" } ] } By mapping "input": "public" to "output": ".", public/manifest.webmanifest is output cleanly at /manifest.webmanifest with HTTP 200 OK. 3. Understanding Mobile & iOS Safari PWA Requirements To test real PWA capabilities on an iPhone: HTTPS Requirement: Desktop Chrome treats http://localhost as a secure origin. However, mobile devices (especially iOS Safari) require a valid HTTPS connection to register Service Workers and enable installable features. Standalone Installation: On iOS, standalone PWA capabilities activate after the user opens Safari, taps Share $\rightarrow$ Add to Home Screen, and launches the app from the standalone home screen icon. 4. Instant Production Deployment with Surge To test real PWA capabilities on any mobile device without complex SSL certificate setup, deploy your production build folder (www/) using Surge.sh: Step 1: Build the production bundle ionic build --prod Step 2: Deploy to Surge npx surge www Surge will immediately output a live, trusted HTTPS URL (e.g. https://my-ionic-pwa.surge.sh). 5. Testing Mobile Capabilities on iPhone Open Safari on your iPhone and navigate to your Surge HTTPS URL (https://my-ionic-pwa.surge.sh). Tap the Share button in Safari $\rightarrow$ Select Add to Home Screen. Launch the app from the new icon on your home screen. Experience your native-like mobile app running directly from the home screen! 6. Pro Tip: Future-Proof Code with Capacitor Plugins Instead of calling browser Web APIs directly (like navigator.clipboard or custom camera file inputs), access device capabilities through official Capacitor Plugins (such as @capacitor/camera, @capacitor/clipboard, @capacitor/share, @capacitor/geolocation, and @capacitor/preferences). [!TIP] Why This Matters: Official Capacitor plugins feature first-class web implementations. When your app runs in the browser or PWA, Capacitor automatically uses standard web APIs and UI fallbacks (via @ionic/pwa-elements). If you ever decide to publish your app to the Apple App Store or Google Play Store down the road, you won't need to change a single line of code—Capacitor seamlessly switches to native iOS and Android SDKs! Conclusion Building an installable, native-like mobile PWA with Angular & Ionic gives your users instant loading times, smooth gestures, and a native mobile feel right from the browser—bypassing app store review delays completely while leaving the door open for native app store deployment anytime. Happy coding! 🚀

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More Programming & Dev News