apktesting_reporter 0.1.0
apktesting_reporter: ^0.1.0 copied to clipboard
In-app bug reporting client for apktesting.com testing jobs.
apktesting_reporter #
Flutter client for submitting in-app bug reports to apktesting.com testing jobs.
This repository contains two Flutter projects:
packages/apktesting_reporter/ # Reusable SDK package: publish this
packages/apktesting_reporter/example/ # Demo/test app: do not add this to customer apps
Developers install only the apktesting_reporter package. The example folder is included so the SDK can be demonstrated and tested before publishing.
Published Dependency #
After publishing version 0.1.0 to pub.dev, a developer adds this to their own Flutter app:
dependencies:
apktesting_reporter: ^0.1.0
The SDK does not replace the developer's app and does not create a second production app. It is a library integrated into the developer's existing Flutter app before the APK/AAB is rebuilt and uploaded for testing.
Current Features #
- Typed report model.
- Multipart submission to
/api/sdk/reports. - Firebase ID-token authorization.
- Automatic Flutter app-surface screenshot capture through
ApktestingScreenshotController. - Optional shake-to-open reporting through
ApktestingShakeDetector. - Optional package, app version, Android version, and device metadata.
- Optional voice-note bytes for audio attachments.
- Optional app-log bytes for TXT, JSON, or CSV attachments.
- In-memory retry queue through
ApktestingOfflineQueue. - Reusable floating report button.
The package accepts recorded audio bytes and uploads them as a voice note. Microphone recording and permission handling remain host/plugin-specific. App logs must be explicitly collected by the host app; the SDK does not intercept network traffic or secrets. Native Android full-device capture is also separate from the current Flutter RepaintBoundary app-surface capture.
The example app includes microphone recording using the record package. It requests microphone permission at the moment the tester chooses Record voice note, records an AAC/M4A file in temporary storage, and attaches the bytes to the report. Production host apps should show their own permission explanation and follow their platform privacy requirements.
Usage #
Add the package from the local repository while the SDK is under development:
dependencies:
apktesting_reporter:
path: ../apktesting_reporter
Create a client with the signed-in tester's Firebase ID token:
final reporter = ApktestingReporterClient(
apiBaseUrl: 'https://your-apktesting-domain.com',
idToken: firebaseIdToken,
);
final reportIdResponse = await reporter.submit(
ApktestingReport(
jobId: assignedJobId,
title: 'Login button is inactive',
description: 'The login button does not respond after valid credentials are entered.',
reproductionSteps: '1. Open Login\n2. Enter valid credentials\n3. Tap Login',
expectedResult: 'The dashboard opens.',
actualResult: 'The screen remains unchanged.',
severity: 'high',
packageName: 'com.example.app',
appVersion: '2.4.1',
screenshot: screenshotBytes,
screenshotFileName: 'login-button.png',
),
);
reporter.close();
Use the retry queue when a report may be submitted without a reliable connection:
final queue = ApktestingOfflineQueue(reporter);
await queue.submitOrQueue(report);
// Call after connectivity returns. The host app can also call this on resume.
await queue.flush();
The queue is intentionally in memory. It does not persist Firebase tokens or report attachments to disk. A durable encrypted queue can be added later with a host application storage policy.
Wrap the host app surface to enable screenshot capture and shake-to-open reporting:
ApktestingShakeDetector(
onShake: openReporter,
child: screenshotController.captureSurface(const MyApp()),
)
Shake detection uses the accelerometer with a cooldown to avoid duplicate opens. The default threshold is 18; both threshold and cooldown can be configured.
The server validates that the Firebase user is an approved tester assigned to the active job. Do not place Firebase Admin credentials or permanent secrets in the Flutter application.
Package Validation #
Run from this directory:
flutter pub get
flutter analyze
flutter test