Deploying

Make sure you install the necessary dependencies to create the native binaries for each platform. More information here.

ionshop-x.x.x/app:~$ ionic capacitor build android --prod
ionic capacitor build ios --prod

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:

  1. Create the provisioning profiles on development and production mode in the Apple Developer Portal. Install both profiles on your computer.
  2. Double-click the file ios/App/App.xcworkspace. On the option Signing (Debug) select the development profile and in Signing (Release) the production profile.

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.

Deploy PWA to Netlify

First, we need to deploy the app to a Github repo. Create a new repository here.

Now, open you command line in the folder ionshop-x-x-x/app.

Create a new local 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:your-username-here/your-repo-name-here.git

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.

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.