はじめに
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-alarm`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/ja/docs/plugins/alarm/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
Section titled “インストール”npm install @capgo/capacitor-alarmnpx cap syncyarn add @capgo/capacitor-alarmnpx cap syncpnpm add @capgo/capacitor-alarmnpx cap syncbun add @capgo/capacitor-alarmnpx cap sync- iOS: iOS 26以降のみ。このプラグインは
AlarmKitAPIに依存しており、それ以前のバージョンまたはフレームワークが利用できない場合はサポート対象外と報告されます。 - Android:
AlarmClockインテントを使用。動作はデフォルトのClockアプリとOEMポリシーに依存します。
注: このプラグインはネイティブアラームアクション(作成/開く)のみを公開します。カスタムのアプリ内アラームスケジューリング/CRUDは実装していません。
createAlarm(…)
Section titled “createAlarm(…)”createAlarm(options: NativeAlarmCreateOptions) => Promise<NativeActionResult>プラットフォームの時計アプリを使用してネイティブOSアラームを作成します。 AndroidではAlarm Clockインテントを使用し、iOSではAlarmKitを使用します(iOS 26以降で利用可能な場合)。
| パラメータ | 型 |
|---|---|
options | NativeAlarmCreateOptions |
戻り値: Promise<NativeActionResult>
openAlarms()
Section titled “openAlarms()”openAlarms() => Promise<NativeActionResult>プラットフォームのネイティブアラームリストUIを開きます(利用可能な場合)。
戻り値: Promise<NativeActionResult>
getOSInfo()
Section titled “getOSInfo()”getOSInfo() => Promise<OSInfo>OSと機能に関する情報を取得します。
戻り値: Promise<OSInfo>
requestPermissions(…)
Section titled “requestPermissions(…)”requestPermissions(options?: { exactAlarm?: boolean | undefined; } | undefined) => Promise<PermissionResult>プラットフォームでアラーム使用に関連する権限をリクエストします。 Androidでは、正確なアラームのために設定にルーティングされる場合があります。
| パラメータ | 型 |
|---|---|
options | { exactAlarm?: boolean; } |
戻り値: Promise<PermissionResult>
インターフェース
Section titled “インターフェース”NativeActionResult
Section titled “NativeActionResult”| プロパティ | 型 |
|---|---|
success | boolean |
message | string |
NativeAlarmCreateOptions
Section titled “NativeAlarmCreateOptions”プラットフォームの時計アプリを介してネイティブOSアラームを作成するためのオプション。
| プロパティ | 型 | 説明 |
|---|---|---|
hour | number | 24時間形式の時間(0-23) |
minute | number | 分(0-59) |
label | string | アラームのオプションラベル |
skipUi | boolean | Androidのみ: 可能な場合UIをスキップ |
vibrate | boolean | Androidのみ: アラームをバイブレーションに設定 |
OSInfo
Section titled “OSInfo”現在のOSと機能に関する返される情報。
| プロパティ | 型 | 説明 |
|---|---|---|
platform | string | ’ios’ | ‘android’ | ‘web’ |
version | string | OSバージョン文字列 |
supportsNativeAlarms | boolean | プラットフォームがネイティブアラームアプリ統合を公開しているかどうか |
supportsScheduledNotifications | boolean | ローカル通知のスケジューリングがサポートされているかどうか |
canScheduleExactAlarms | boolean | Androidのみ: 正確なアラームが許可されているかどうか |
PermissionResult
Section titled “PermissionResult”権限リクエストの結果。
| プロパティ | 型 | 説明 |
|---|---|---|
granted | boolean | リクエストされたスコープの全体的な許可 |
details | Record<string, boolean> | 権限キー別のオプション詳細 |