__CAPGO_KEEP_0__のインストールと使用を開始し、現在の__CAPGO_KEEP_2__ __CAPGO_KEEP_3__を活用してください。 - __CAPGO_KEEP_4__アプリの更新をリアルタイムで管理することなく、ストアの手間を省き、5分で...

Getting Started

GitHub

AI-Assisted セットアップを使用してプラグインをインストールできます。AI ツールに Capgo スキルを追加するには、以下のコマンドを実行します。

ターミナル画面
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次に、以下のコマンドを使用してください。

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-alarm` plugin in my project.

Manual Setup を使用する場合は、以下のコマンドを実行してください。プラットフォーム固有の指示は下記を参照してください。

ターミナル画面
bun add @capgo/capacitor-alarm
bunx cap sync
import { CapgoAlarm } from '@capgo/capacitor-alarm';

プラットフォームの時計アプリを使用してネイティブOSのアラームを作成します。 Androidの場合、このアラームはアラームクロックのインテントを使用します。iOSの場合、iOS 16以降の場合はAlarmKitを使用します。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.createAlarm({
hour: 7,
minute: 30,
label: 'Wake up',
skipUi: false,
vibrate: true
});
console.log('Alarm created:', result.success);

プラットフォームのネイティブのアラームリストUIを開きます。利用可能な場合。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.openAlarms();
if (result.success) {
console.log('Alarms UI opened');
}

OSと機能に関する情報を取得します。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const info = await CapgoAlarm.getOSInfo();
console.log('Platform:', info.platform);
console.log('Supports native alarms:', info.supportsNativeAlarms);
if (info.platform === 'android') {
console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);
}

requestPermissions

「requestPermissions」

プラットフォームでアラームの使用に必要な権限を要求します。 Androidの場合、正確なアラームのために設定画面にルーティングする場合があります。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.requestPermissions({ exactAlarm: true });
if (result.granted) {
console.log('Permissions granted');
} else {
console.log('Permissions denied');
}

checkPermissions

「checkPermissions」

iOSおよびAndroidのネイティブアラームへのアクセスをトリガーせずに現在の許可状態を確認します。 iOSではAlarmKitの準備状況を、Androidでは機能詳細を報告します。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const status = await CapgoAlarm.checkPermissions();
console.log('AlarmKit allowed?', status.details?.alarmKit);

このアプリによって設定されたスケジュールされたアラームの一覧を取得します。 iOS 26+では、AlarmKitからアラームを返します。Androidでは、システムがアラームをqueryするAPIを提供していないため、サポートされていません。

import { CapgoAlarm } from '@capgo/capacitor-alarm';
const { alarms } = await CapgoAlarm.getAlarms();
console.log('Scheduled alarms:', alarms);
alarms.forEach(alarm => {
console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);
});

ネイティブOSアラームを作成するためのプラットフォーム時計アプリのオプションです。

export interface NativeAlarmCreateOptions {
/** Hour of day in 24h format (0-23) */
hour: number;
/** Minute of hour (0-59) */
minute: number;
/** Optional label for the alarm */
label?: string;
/** Android only: attempt to skip UI if possible */
skipUi?: boolean;
/** Android only: set alarm to vibrate */
vibrate?: boolean;
}

ネイティブアクションの結果です。

export interface NativeActionResult {
/** Whether the action was successful */
success: boolean;
/** Optional message with additional information */
message?: string;
}

現在のOSと機能に関する情報を返します。

export interface OSInfo {
/** Platform identifier: 'ios' | 'android' | 'web' */
platform: string;
/** OS version string */
version: string;
/** Whether the platform exposes a native alarm app integration */
supportsNativeAlarms: boolean;
/** Whether scheduling local notifications is supported */
supportsScheduledNotifications: boolean;
/** Android only: whether exact alarms are allowed */
canScheduleExactAlarms?: boolean;
}

パーミッションの要求の結果

export interface PermissionResult {
/** Overall grant for requested scope */
granted: boolean;
/** Optional details by permission key */
details?: Record<string, boolean>;
/** Optional human readable diagnostic */
message?: string;
}

予定されたアラームに関する情報

export interface AlarmInfo {
/** Unique identifier for the alarm */
id: string;
/** Hour of day in 24h format (0-23) */
hour: number;
/** Minute of hour (0-59) */
minute: number;
/** Optional label for the alarm */
label?: string;
/** Whether the alarm is enabled */
enabled?: boolean;
}

このページはプラグインから生成されます。 src/definitions.ts. 同期を再実行してください。 公開 API がアップストリームで変更されたとき。

Getting Started から続けてください。

Section titled “Getting Started から続けてください”。

Capgo を使用している場合 Getting Started ダッシュボードと Capgo の API を計画するには、Capgo を接続してください。 Capacitor の @capgo/capacitor-alarm を使用します。 Capacitor の @capgo/capacitor-alarm のネイティブ機能について Capgo の API オーバービューについて Capgo の API オーバービューの実装詳細について 導入 実装の詳細については、 API キー 実装の詳細については、API キー、 デバイス 実装の詳細については、デバイス。