Deploying
Build the android app in production mode.
ionic capacitor build android --prod
Build the iOS app in production mode.
ionic capacitor build ios --prod
Note
Be sure to update the production environment file (environment.prod.ts) with your own data.
These commands will create an optimized and suitable compilation for Google Play and App Store, respectively.
Android requires that all App Bundles be digitally signed with a certificate before they can be installed. Go to this guide to learn how to generate your private key and use it to sign the APK.
Do the following to properly sign the iOS build:
- Create the provisioning profiles on development and production mode in the Apple Developer Portal. Install both profiles on your computer.
- Double-click the file
ios/App/App.xcworkspace
. On the option Signing (Debug) select the development profile and in Signing (Release) the production profile.
Note
Don’t forget to activate push notifications in Xcode. Simply go to the project editor for your target and then click on the Capabilities tab. Look for Push Notifications and toggle its value to ON.
Deploying to Netlify
Create a new github repository here.
Open your command line in the app folder, and initialize a new repo:
git init
Add all the project files to the repo:
git add .
Commit the changes
git commit -m "Initial commit"
Add the remote repo created on Github
git remote add origin git@github.com...
Finally push the changes
git push origin master
Create a new account on Netlify.
Click on New site from Git.
Now choose Github, if you’re using another git system choose it.
Next, choose your repo.
We have to set some settings for the deployment.
For Branch choose master, If you’re using different branch choose it.
For Build command type ng build --prod --service-worker
For Publish directory, type www/browser
.
Click Deploy site.
It’ll take a minute to deploy the site and give us the URL.
That’s it. Next you’d want to use a custom domain for your app.
Click on Domain Settings > Add custom domain, and enter your domain name. Click Verify, and the domain will be validated.
After adding a custom domain, the domain name will normally appear grayed out in the Custom domains panel, with a Check DNS configuration link next to it. This means Netlify cannot serve your site correctly under that domain.
To serve your site under a custom domain, you need to point DNS records for the domain at the Netlify servers.
Click Check DNS configuration next to the custom domain to see customized instructions on the DNS records you need to configure.
Depending on your DNS provider, changes to DNS records can take several hours to propagate and take effect for the entire internet.
If you have any suggestions or questions related to this documentation do not hesitate to contact us.