跳过主要内容
返回插件
@capgo/capacitor-appinsights
教程
@capgo/capacitor-appinsights

AppInsights

Track app usage, performance metrics, and user behavior with Apptopia AppInsights

指南

AppInsights教程

使用@capgo/capacitor-appinsights

AppInsights的包装器 https://github.com/apptopia/appinsights SDK.

安装

bun add @capgo/capacitor-appinsights
bunx cap sync

此插件暴露的内容

  • init - 初始化应用程序SDK。
  • setUserId - 在初始化后设置或更新用户 ID。
  • getState - 获取SDK的当前状态。

示例用途

init

初始化应用程序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
  });

setUserId

设置或更新用户 ID 后初始化。

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

await CapacitorAppInsights.setUserId({} as { userId: string });

getState

获取SDK的当前状态。

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

await CapacitorAppInsights.getState();

完整参考

继续使用 @capgo/capacitor-appinsights

如果您正在使用 使用 @capgo/capacitor-appinsights 为原生插件工作做好准备,连接它 @capgo/capacitor-appinsights 在 @capgo/capacitor-appinsights 中了解实现细节 开始使用 在开始使用中了解实现细节 Capgo 插件目录 为产品工作流程在Capgo插件目录中 Capacitor插件由Capgo 为Capacitor插件由Capgo的实现细节 添加或更新插件 添加或更新插件的实现细节