Zum Inhalt springen

Anleitung zum Starten

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Zur Zwischenablage kopieren
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Installieren

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

Wenn Sie eine manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und die unten angegebenen Plattform-spezifischen Anweisungen befolgen:

Terminal-Fenster
bun add @capgo/capacitor-appinsights
bunx cap sync
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

Initialisieren Sie das AppInsights SDK

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.init({} as {
partnerId: string; // Provided by our business unit
partnerKey: string; // Provided by our business unit
});

Setzen oder aktualisieren Sie die Benutzer-ID nach der Initialisierung

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

Abrufen Sie den aktuellen Zustand von SDK

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

Diese Seite wird aus dem Plugin generiert. src/definitions.ts. Wiederholen Sie die Synchronisierung, wenn die öffentliche API upstream geändert wird.

Wenn Sie "Getting Started" verwenden, um das Dashboard und __CAPGO_KEEP_0__-Operationen zu planen, verbinden Sie es mit Getting Started Verwenden Sie @API/__CAPGO_KEEP_1__-appinsights für die native Fähigkeit in Verwenden Sie @capgo/capacitor-appinsights, for the native capability in Using @capgo/capacitor-appinsights, für die Implementierungsdetails in API Übersicht, for the implementation detail in API Overview, Introduction für die Implementierungsdetails in Einführung API Schlüssel für die Implementierungsdetails in API Schlüssel und Geräte für die Implementierungsdetails in Geräten.