搜索插件、代码仓与 APP 分类

插件详情v0.5.0

aptabase_flutter

Aptabase 的 Flutter SDK:开源、注重隐私且简单的移动、桌面和 Web 应用程序分析工具

AndroidiOSmacOSWindowsLinux
近 30 天下载
8300
喜欢数
18
Pub 分数
150

安装插件

flutter pub add aptabase_flutter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Aptabase Flutter SDK 使开发者能够将轻量级、以隐私为先的分析功能集成到移动、桌面和网络应用程序中。该 SDK 以透明度和用户隐私为核心设计,仅收集最少的数据,且不追踪个人标识符。SDK 是开源的,易于设置,设计简洁,非常适合注重道德数据收集的应用程序。它支持在 Android、iOS、macOS、Windows 和 Linux 平台上进行实时事件跟踪。

适合场景

  • 跟踪用户参与度
  • 监控应用程序性能
  • 分析功能使用情况
  • 收集崩溃报告
  • 测量会话时长

主要特点

  • 注重隐私的数据收集
  • 开源且透明
  • 实时分析
  • 跨平台支持
  • 最小数据占用

适合对象

  • 注重隐私的初创公司
  • 面向监管市场的应用
  • 寻求简单分析的开发者
  • 开源项目
  • 小型到中型应用

使用建议

  • 有限的高级细分
  • 无内置用户识别
  • 需要手动设置自定义事件
  • 不适合企业级分析
  • 依赖外部后端服务

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Aptabase

aptabase_flutter

pub package pub points

Instrument your app with Aptabase, an Open Source, Privacy-First, and Simple Analytics for Mobile, Desktop, and Web Apps.

Platform Support

Android iOS MacOS Web Linux Windows
✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Install

You can install the SDK by running the following command:

flutter pub add aptabase_flutter

Android Requirements

If you're targeting Android, you'll need to add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

Usage

First, you need to get your App Key from Aptabase, you can find it in the Instructions menu on the left side menu.

On your main.dart, import package:aptabase_flutter/aptabase_flutter.dart and initialized the SDK.

void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+ await Aptabase.init("<YOUR_APP_KEY>"); // 👈 this is where you enter your App Key

  runApp(const MyApp());
}

Note: You need to change your main function to be async and call WidgetsFlutterBinding.ensureInitialized(); before initializing the SDK.

Afterward, you can start tracking events with Aptabase.instance anywhere in your Dart. Here's an example:

import 'package:aptabase_flutter/aptabase_flutter.dart';

class _CounterState extends State<Counter> {
  int _counter = 0;

  // Tracking how many times the user has clicked the button, alongside the current counter value
  void _incrementCounter() {
    Aptabase.instance.trackEvent("increment", { "counter": _counter });
    
    setState(() {
      _counter++;
    });
  }
}

A few important notes:

  1. The SDK will automatically enhance the event with some useful information, like the OS, the app version, and other things.
  2. You're in control of what gets sent to Aptabase. This SDK does not automatically track any events, you need to call trackEvent manually.
    • Because of this, it's generally recommended to at least track an event at startup
  3. You do not need to await for the trackEvent function, it'll run in the background.
  4. Only strings and numbers values are allowed on custom properties

Preparing for Submission to Apple App Store

When submitting your app to the Apple App Store, you'll need to fill out the App Privacy form. You can find all the answers on our How to fill out the Apple App Privacy when using Aptabase guide.

For AI/LLM integration instructions, see llms.txt

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。