__CAPGO_KEEP_0__ __CAPGO_KEEP_5__
@capgo/capacitor-rich-notifications コミュニケーション オープンソース

リッチ通知 Capacitor プラグイン

Android チャンネル、進行状況レイアウト、アクションボタン、スケジュール、iOS 割り込みレベルを備えたローカル通知

インストール

bun add @capgo/capacitor-rich-notifications bunx cap sync
npm, pnpm または yarn
  • npm install @capgo/capacitor-rich-notifications
  • pnpm add @capgo/capacitor-rich-notifications
  • yarn add @capgo/capacitor-rich-notifications

ガイド

Capacitor でリッチな通知を使用する方法

Using @capgo/capacitor-rich-notifications

Androidチャンネル、進行状況レイアウト、アクションボタン、スケジュール、iOS中断レベルを備えたローカル通知

インストール

bun add @capgo/capacitor-rich-notifications
bunx cap sync

このプラグインが公開するもの

  • checkPermission - ローカル通知の許可状態を確認する
  • requestPermission - ローカル通知の許可を求める
  • createChannel - Android通知チャンネルを作成する
  • createChannelGroup - Androidチャンネルグループを作成する
  • deleteChannel - Android通知チャンネルを削除する
  • display - ローカル通知を即時表示する
  • schedule - ローカル通知を後日スケジュールする
  • cancel - 指定IDの通知をキャンセルする
  • cancelAll - このプラグインが管理するすべての通知をキャンセルします。
  • getDisplayed - シェードまたはセンターで表示された通知の一覧を表示します。
  • getPending - 表示されていないスケジュールされた通知の一覧を表示します。
  • getInitialNotification - アプリを開いた通知を返します。
  • setBadge - iOS用のアプリアイコンのバッジカウントを設定します。
  • registerActions - 再利用可能なアクションカテゴリを登録します。
  • getPluginVersion - プラットフォーム実装バージョンマーカーを返します。
  • addListener - 押し下しと消去イベントをリスンします。

- 例えば

requestPermission - 完全なリファレンス display

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.requestPermission();

await RichNotifications.createChannel({
  id: 'messages',
  name: 'Messages',
  importance: 'high',
});

await RichNotifications.display({
  title: 'Hello',
  body: 'Tap to open the app',
  channelId: 'messages',
});

schedule

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.schedule({
  notification: {
    id: 'reminder-1',
    title: 'Reminder',
    body: 'Your appointment starts soon',
    channelId: 'messages',
  },
  trigger: { type: 'timestamp', timestamp: Date.now() + 60_000 },
});

- __CAPGO_KEEP_0__:

FAQ

リッチ通知プラグインのFAQ

Capacitor Rich Notifications プラグインを Capacitor アプリにインストールする方法は何ですか。

「bun」コマンドを実行してください。 「bun add @capgo/capacitor-rich-notifications」(または「npm install @capgo/capacitor-rich-notifications」)を実行し、次に「bunx cap sync」を実行してください。 iOSとAndroidのプロジェクトがネイティブ「code」を取得できるようにします。 「@capgo/capacitor-rich-notifications」をアプリ「code」からインポートしてください。

「@capgo/capacitor-rich-notifications」は、React、Vue、Angularとどのように動作するか?

Yes. Rich Notifications is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-rich-notifications support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

「@capgo/capacitor-rich-notifications」は無料でオープンソースですか?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-rich-notifications/ and the package is free to install from npm. Bug reports and pull requests are welcome.

「code」をアップデートすることはApp Storeのレビューなしで可能ですか?

プラグインをインストールまたはアップグレードするとネイティブ「code」が変更されます。 そのため、ストアのビルドが必要になります。 その後、JavaScript、HTML、CSSの変更がプラグインを呼び出すと、Capgoのライブアップデートで即時配信できます。

アプリレビューを待たずに Rich Notifications の変更を配信する

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo