メインコンテンツへスキップ

はじめに

GitHub

AIアシストセットアップを使ってプラグインをインストールできます。以下のコマンドで、お使いの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-appinsights` plugin in my project.

手動セットアップを希望する場合は、以下のコマンドでプラグインをインストールし、下記のプラットフォーム別の手順に従ってください:

ターミナルウィンドウ
bun add @capgo/capacitor-appinsights
npx cap sync
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

クイックスタート

「Quick start」セクション
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.init({
partnerId: 'partner-id-123',
partnerKey: 'partner-key-123',
});
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.setUserId({ userId: 'user-id-123' });
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
const result = await CapacitorAppInsights.getState();
console.log(result);

よくある落とし穴

「Common pitfalls」セクション
  • ネイティブ同期: 実行 npx cap sync プラグインのアップグレード後。
  • 信頼できる情報源: 信頼する src/definitions.ts GitHub リポジトリ内に

AppInsights SDK を初期化する

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.init({
partnerId: 'partner-id-123',
partnerKey: 'partner-key-123',
});

初期化後にユーザーIDを設定または更新する

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.setUserId({ userId: 'user-id-123' });

SDK の現在の状態を取得する

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
const result = await CapacitorAppInsights.getState();
console.log(result);
export interface PanelSDKState {
initCompleted: boolean; // SDK initialization status
jobScheduled: boolean; // Background job scheduling status
permissionAcquired: boolean; // Required permissions status
}

このページはプラグインの src/definitions.tsから生成されています。上流で公開 API が変更されたら、sync を再実行してください。

以下を使用している場合: はじめに ダッシュボードと API の操作を計画するには、以下と連携してください @capgo/capacitor-appinsights の使い方 @capgo/capacitor-appinsights のネイティブ機能については、 API の概要 API Overview の実装の詳細については、 はじめに Introduction の実装の詳細については、 API キー API Keys の実装の詳細については、 デバイス Devices の実装の詳細については。