Skip to content

Capawesome January 2025 Update

The Capawesome January update is here! This update includes new features and improvements for Capawesome Cloud and our Plugins. Let's take a look at the most important changes.

CLI

Custom Properties

The Capawesome CLI now supports custom properties for the apps:bundles:create command:

npx capawesome apps:bundles:create --custom-property version=1.1.0 --custom-property silentUpdate=true

Custom properties allow you to store additional information in a bundle and can be retrieved by the Live Update plugin. This allows you to customize the behavior of your app for specific bundles.

Cloud

Landing Page

We've just launched our brand new landing page for Capawesome Cloud. The new landing page is available at cloud.capawesome.io and provides an overview of all features and benefits of Capawesome Cloud, including customer testimonials and pricing information. The Capawesome Cloud Console, which was previously accessible at console.capawesome.io, has been moved to console.cloud.capawesome.io.

Do you like the new landing page? Let us know what you think!

GitHub Action

The Cloud Live Update Action now uses the latest version of the Capawesome CLI. This update includes various improvements and bug fixes. The Cloud Live Update Action allows you to deploy a live update to the Capawesome Cloud directly from your GitHub Actions workflow:

- uses: capawesome-team/[email protected]
  with:
    # The Capawesome Cloud app ID.
    # Required.
    appId: ''
    # The channel to deploy the update to.
    channel: ''
    # The path to the bundle to upload. Must be a folder or zip archive.
    # Required.
    path: ''
    # The Capawesome Cloud API token.
    # Required.
    token: ''

Plugins

All plugins now support Capacitor 7 and the Swift Package Manager (SPM). This means that you can now use the plugins with the latest version of Capacitor and add them to your Xcode project using SPM. Read on to learn more about the latest changes to our plugins.

Breaking Changes

We have published some breaking changes to our plugins this month. Please make sure to carefully review the changes before updating your plugins. You can find more information about the breaking changes in the respective BREAKING.md files in the plugin repositories.

App Shortcuts

New icon option

The App Shortcuts plugin now supports the icon option. This option allows you to specify an icon for the shortcut:

import { Capacitor } from '@capacitor/core';
import { AppShortcuts } from '@capawesome/capacitor-app-shortcuts';

const set = async () => {
  await AppShortcuts.set({
    shortcuts: [
      {
        id: 'feedback',
        title: 'Feedback',
        description: 'Send feedback to the app developers',
        icon: Capacitor.getPlatform() === 'ios' ? 6 : 17301547,
      }
    ],
  });
};

The icon option accepts a number. On Android, the icon is the constant value of the R.drawable enum. On iOS, the icon is the constant value of the UIApplicationShortcutIcon.IconType enum.

Firebase

Cloud Firestore

New getCountFromServer method

The Cloud Firestore plugin now supports a getCountFromServer method. This method allows you to get the number of documents in a collection from the server:

import { FirebaseFirestore } from '@capacitor-firebase/firestore';

const getCountFromServer = async () => {
  const { count } = await FirebaseFirestore.getCountFromServer({
    reference: 'users',
  });
  return count;
};

Live Update

Automatic rollbacks disabled by default

The default value of the readyTimeout configuration option has been changed from 10000 to 0 to disable the timeout by default. This should make it easier to get started with the plugin. This feature has often caused confusion and issues for users who were not aware of the timeout. However, it is strongly recommended to configure this option so that the plugin can roll back to the default bundle in case of problems:

{
  "plugins": {
    "LiveUpdate": {
      "readyTimeout": 10000
    }
  }
}
New ReadyResult type

The ready() method now returns a ReadyResult object with the following properties:

import { LiveUpdate } from '@capawesome/capacitor-live-update';

const ready = async () => {
  const result = await LiveUpdate.ready();
  console.log('Previous Bundle ID: ', result.previousBundleId);
  console.log('Current Bundle ID: ', result.currentBundleId);
  console.log('Rollback performed? ', result.rollback);
};

This change allows you to get more information about the current state of the app after the ready() method has been called. For example, you can display a message to the user if an update has failed.

Custom properties

The fetchLatestBundle(...) method now also returns the custom properties of the latest bundle:

import { LiveUpdate } from '@capawesome/capacitor-live-update';

const fetchLatestBundle = async () => {
  const { customProperties } = await LiveUpdate.fetchLatestBundle();
  console.log('Custom Properties: ', customProperties);
};

This allows you to customize the behavior of your app based on the custom properties of the latest bundle. For example, you could use a custom property silentUpdate to decide whether the user should be asked before downloading the bundle or not.

New downloadBundleProgress listener

The downloadBundle(...) method now emits a downloadBundleProgress event with the download progress:

import { LiveUpdate } from '@capawesome/capacitor-live-update';

const downloadBundle = async () => {
  // Listen for download progress
  await LiveUpdate.addListener('downloadBundleProgress', (event) => {
    console.log('Bundle ID: ', event.bundleId);
    console.log('Progress: ', event.progress);
    console.log('Downloaded bytes: ', event.downloadedBytes);
    console.log('Total bytes: ', event.totalBytes);
  });
  // Download the latest bundle
  await LiveUpdate.downloadBundle();
};

This change allows you to display a progress bar or other UI elements to the user while the bundle is being downloaded.

ML Kit

Barcode Scanning

New resolution option

The Barcode Scanning plugin now supports a resolution option. This option allows you to specify the resolution of the barcode scanning process:

import { BarcodeScanner, Resolution } from '@capacitor-mlkit/barcode-scanning';

const startScan = async () => {
  await BarcodeScanner.startScan({
    resolution: Resolution['1280x720'],
  });
};

The possible values for the resolution option are:

  • 640x480
  • 1280x720
  • 1920x1080

Screenshot

We have published a new Screenshot plugin. The Screenshot plugin allows you to take screenshots of the current screen and can be used for various purposes, such as error reporting or sharing content.

import { Screenshot } from '@capawesome/capacitor-screenshot';

const take = async () => {
  const { uri } = await Screenshot.take();
  console.log('Screenshot saved at:', uri);
};