Skip to content

Capawesome November 2024 Update

The Capawesome November 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.

Cloud

Automatically delete old bundles

There are now two new options available for automatically deleting old bundles so that you don't have to worry about the storage limit:

  1. Set a bundle limit: You can set a limit for the number of bundles that can be assigned to a channel. If this limit is reached, the oldest bundle will be deleted automatically. For example, this is how you can set a bundle limit of 5 using the Capawesome CLI when creating a channel:

    npx capawesome apps:channels:create --bundle-limit 5
    
  2. Set an expiration date: You can set an expiration date for a bundle. If this date is reached, the bundle will be deleted automatically. For example, this is how you can automatically delete a bundle after 30 days using the Capawesome CLI when creating a bundle:

    npx capawesome apps:bundles:create --expires-in-days 30
    

Both options are also available via the Capawesome Cloud Console.

Delete multiple items at once

You can now finally delete multiple Bundles, Channels, Devices and Tokens at once via the Capawesome Cloud Console. Simply select the items you want to delete and click the Delete button.

Plugins

Android Foreground Service

The Android Foreground Service plugin now has three new methods that allow you to update the foreground service notification and create/delete notification channels:

import { ForegroundService, Importance } from '@capawesome-team/capacitor-android-foreground-service';

/**
 * Update the foreground service notification.
 */
const updateForegroundService = async () => {
  await ForegroundService.updateForegroundService({
    id: 1,
    title: 'Title',
    body: 'Body',
    smallIcon: 'ic_stat_icon_config_sample',
  });
};

/**
 * Create a notification channel.
 */
const createNotificationChannel = async () => {
  await ForegroundService.createNotificationChannel({
    id: 'default',
    name: 'Default',
    description: 'Default channel',
    importance: Importance.Default,
  });
};

/**
 * Delete a notification channel.
 */
const deleteNotificationChannel = async () => {
  await ForegroundService.deleteNotificationChannel({
    id: 'default',
  });
};

Thanks to @xsorifc28 and @ebarooni for the contributions!

App Review

Say hi to our brand new App Review plugin for Android and iOS! This plugin not only allows you to request in-app reviews but also to open the app store page of your app and, if possible, open the dialog to leave a review. Here is an example of how you can use this plugin:

import { AppReview } from '@capawesome/capacitor-app-review';

const openAppStore = async () => {
  await AppReview.openAppStore({
    appId: '123456789'
  });
};

const requestReview = async () => {
  await AppReview.requestReview();
};

Thanks to @mertyldrr for the contribution!

App Update

The App Update plugin now has a new appId property that allows you to specify the app ID of your app:

import { AppUpdate } from '@capawesome/capacitor-app-update';

const openAppStore = async () => {
  await AppUpdate.openAppStore({
    appId: '123456789'
  });
};

This solves the problem where the app was not always found in the App Store and speeds up the entire plugin call.

File Picker

The File Picker plugin now has a new pickDirectory method that allows you to pick a directory:

import { FilePicker } from '@capawesome/capacitor-file-picker';

const pickDirectory = async () => {
  const result = await FilePicker.pickDirectory();
  console.log('Picked directory path:', result.path);
};

In combination with the Filesystem plugin, you can now easily access multiple files in a directory at once without having to select each file individually.

Thanks to @ebarooni for the contribution!

ML Kit Barcode Scanning

The ML Kit Barcode Scanning plugin got two new features this month.

Compatibility with Torch Plugin

The plugin is now compatible with the Torch plugin which means that you no longer have to use the deprecated torch methods of the ML Kit Barcode Scanning plugin.

Barcode Value Types

The plugin now returns the value types of the scanned barcodes. The following value types are available:

Thanks to @mertyldrr for the contribution!

NFC

The NFC plugin now has a new compatibilityMode flag that can help reading some special NDEF tags:

import { Nfc } from '@capawesome-team/capacitor-nfc';

const startScanSession = async () => {
  await Nfc.startScanSession({ 
    compatibilityMode: true 
  });
};

Please be aware that this mode only supports reading NDEF tags and is only available on iOS.

Torch

The Torch plugin has also been updated to be compatible with the ML Kit Barcode Scanning plugin. This means that you can now use the Torch plugin to toggle the flashlight even when scanning barcodes.

Wifi

The Wifi plugin now returns the security types and signal strength for scanned networks:

import { Wifi } from '@capawesome-team/capacitor-wifi';

const scan = async () => {
  await Wifi.addListener('networksScanned', (event) => {
    const firstNetwork = event.networks[0];
    console.log('First network security types:', firstNetwork.securityTypes);
    console.log('First network signal strength:', firstNetwork.rssi);
  });
  await Wifi.startScan();
};