Install Capacitor.
Add Capacitor to your project and create a config for your app
npm install @capacitor/core @capacitor/clinpx cap init [name] [id] --web-dir=dist
Build native mobile apps with web technology and Ember
Add Capacitor to your project and create a config for your app
npm install @capacitor/core @capacitor/clinpx cap init [name] [id] --web-dir=dist
The compiled web assets will be copied into each Capacitor native platform during the next step.
npm run build
Capacitor's native projects exist in their own top-level folders and should be considered part of your app (check them into source control).
npm i @capacitor/ios @capacitor/androidnpx cap add androidnpx cap add ios
With Capacitor installed, adding calls to native device features is as straight forward as calling other JavaScript methods
import Component from '@glimmer/component';import { tracked } from '@glimmer/tracking';import { action } from '@ember/object';import { Geolocation } from '@capacitor/geolocation';
export default class GeolocationComponent extends Component { @tracked loc = null;
@action async getCurrentPosition(){ const loc = await Geolocation.getCurrentPosition() this.loc = loc }}
This is only the beginning. Learn more about the Capacitor development workflow or using more native APIs .