Mobile Apps
Native Device Features in an Ionic App: Camera, Location, Push and Files
Capacitor gives an Ionic app access to the camera, location, push notifications and the file system, but each comes with permissions, platform differences and store rules. Here is how we make these four features reliable on real devices.

An Ionic app that only shows web pages in a frame is hard to justify, and Apple's reviewers tend to agree. The reason to package a web app with Capacitor is to reach the phone itself: take a photo, know where the user is, send a notification, save a file for later. Each of these works well in Capacitor, but each comes with permissions, platform differences and store rules that are easy to underestimate when the rest of the app is ordinary web code.
In our Ionic and Capacitor app development work, these four features cover most of what clients ask for. Our earlier guide to taking a web app into the app stores with Ionic and Capacitor covers packaging and review. This article goes one level deeper, into the device features themselves.
How Capacitor Reaches Native Code
Capacitor runs your web app in a native web view and exposes device features through plugins. Each plugin has a TypeScript API your app calls, plus Swift code for iOS and Kotlin or Java for Android that does the real work. The official plugins, published under @capacitor/, cover the common features; community plugins under @capacitor-community/ and other maintained packages fill many gaps; and when nothing fits, we write a small custom plugin in native code.
Three habits apply to every feature:
- Check the platform. Capacitor.isNativePlatform() lets the same code base behave sensibly in a browser, which matters if the app also runs as a website or PWA.
- Handle permissions explicitly. Most plugins offer checkPermissions() and requestPermissions(). Ask at the moment the feature is needed, with a screen explaining why, and handle "denied" gracefully with a route to the system settings.
- Write honest purpose strings. iOS shows the text from Info.plist keys such as NSCameraUsageDescription in the permission dialog. Vague text like "This app needs the camera" is a common reason for App Store rejection.
Camera and Photos
The @capacitor/camera plugin's getPhoto() can open the camera, the photo library or a prompt offering both, and pickImages() selects several images at once. Practical points we plan for:
- Return a file path, not base64. Requesting the result as a URI keeps large photos out of the JavaScript bridge, which is slow with multi-megabyte strings. Use Capacitor.convertFileSrc() to display it.
- Set quality and size limits. A full-resolution photo from a modern phone is far larger than most uploads need. Resizing on the device saves data and upload time.
- Respect store policies on photo access. Google Play now restricts broad photo and video permissions for apps that only need occasional access, and expects the system photo picker instead. iOS lets users grant access to selected photos only. Your app should work either way.
- Plan the web fallback. In a browser, the camera plugin needs Ionic's PWA Elements package to show its camera interface.
For apps where photos are evidence, such as deliveries or inspections, the capture flow needs more than the plugin: timestamps, compression, retries and storage until upload succeeds. Our article on proof-of-delivery capture with phone cameras covers that end to end.
Location
@capacitor/geolocation provides getCurrentPosition() for a single reading and watchPosition() for continuous updates while the app is open. The main decisions are about accuracy and lifetime:
- High accuracy costs battery and time. A first GPS fix indoors can take a while. Show progress, set a timeout, and accept a coarser reading when that is all the task needs.
- Users may grant approximate location only. Both Android and iOS let users share an approximate position. The app should cope, or explain why precise location matters.
- Background tracking is a different feature. The official plugin stops when the app is in the background. Tracking a courier or field worker with the screen off needs a dedicated background geolocation plugin, a persistent notification on Android, the "Always" permission on iOS, and a clear justification for both store reviews.
Push Notifications
@capacitor/push-notifications registers the device and returns a token through a registration listener, which your server stores against the user. Things to get right:
- Tokens differ by platform. On Android the token comes from Firebase Cloud Messaging; on iOS the plugin returns an APNs token. If you want to send to both through FCM, you either configure FCM with your APNs key and use a plugin that returns FCM tokens on iOS too, or send to APNs directly from your server. Decide this early; it shapes the back end.
- Android 13 and later need runtime permission for notifications, as iOS always has. Ask after the user has seen why notifications help them.
- Foreground behaviour must be configured. By default a notification arriving while the app is open may not be displayed. Decide whether to show it, update the screen, or both.
- Deep links. Tapping a notification should open the relevant screen, which means a payload format and routing logic agreed between app and server.
- Local reminders that do not need a server, such as an appointment alert, belong in @capacitor/local-notifications instead.
Most of our Capacitor apps use FCM on the server side, set up as part of our Firebase development work. For deciding what is worth notifying, our article on notifications parents actually read applies well beyond schools.
Files and Local Storage
@capacitor/filesystem reads and writes files in app directories such as Data, Cache and Documents. A few rules keep it reliable:
- Pick the right directory. Cache can be cleared by the system; Data is private and persistent. Documents on iOS can be made visible in the Files app if users should be able to open exports.
- Avoid pushing large files through the bridge as base64. For downloads and uploads, use native HTTP transfers that write straight to disk, and stream large uploads rather than reading them into memory.
- Use the right store for each kind of data. @capacitor/preferences suits small settings, SQLite suits structured offline data, and secrets such as tokens belong in the iOS Keychain or Android Keystore through a secure storage plugin, not in plain preferences.
- Sharing and opening files in other apps uses the share plugin or a file opener plugin, and on Android requires a correctly configured file provider.
Test on Real Devices, Then Keep Plugins Current
Browsers and simulators hide most of the problems described here: permission dialogs, slow GPS, notification delivery and memory limits all behave differently on a mid-range Android phone. We test every native feature on physical devices on both platforms before release. After launch, Capacitor and its plugins follow yearly major versions tied to new iOS and Android SDK requirements, so plugins need updating to keep the app accepted by the stores. When a feature needs deeper native work, our Android and iOS developers write the custom plugin.
If your Ionic app needs camera, location, push or file features, or existing ones are unreliable, tell us which features you need and on which devices. We will suggest the plugins, permission flow and back-end changes that make them work properly.
Frequently Asked Questions
Can an Ionic app do everything a native app can?
Most business apps, yes. Capacitor plugins cover camera, location, push, files, biometrics, contacts and more, and anything missing can be written as a custom native plugin in Swift or Kotlin. Where Ionic is weaker is in heavy graphics, complex animation and very high-performance processing, where a fully native or Flutter app may be better.
Why does our Ionic app's location tracking stop when the screen turns off?
The standard geolocation plugin only works while the app is in the foreground. Background tracking needs a dedicated background location plugin, a foreground service notification on Android and the Always permission on iOS. Both stores also review background location carefully, so the app must clearly explain why it needs it.
Do we need Firebase to send push notifications from an Ionic app?
Not strictly. Android delivery always goes through Firebase Cloud Messaging, but iOS uses Apple's push service, which your server can call directly. Many teams route both platforms through FCM for simplicity, configuring it with their Apple push key, and use a plugin that returns FCM tokens on iOS as well as Android.
Why was our Ionic app rejected by the App Store over permissions?
The most common causes are vague permission explanations, requesting permissions the app does not clearly use, or asking for them before the user reaches the relevant feature. Each Info.plist usage description should say specifically what the app does with the camera, location or photos, and permissions should be requested in context.
Can the same Ionic code still run as a website?
Yes. Capacitor plugins include web implementations where browsers allow it, such as location and camera through PWA Elements. Features without a web equivalent can be detected with isNativePlatform and hidden or replaced, so one code base can serve the app stores and the browser.








