instabug_flutter 9.1.6 copy "instabug_flutter: ^9.1.6" to clipboard
instabug_flutter: ^9.1.6 copied to clipboard

outdated

Instabug is an in-app feedback and bug reporting tool for mobile apps. With just a simple shake, your users or beta testers can report bugs or send in-app feedback and the SDK will capture an enviro [...]

Instabug for Flutter #

pub package

A Flutter plugin for Instabug.

Available Features #

Feature Status
Bug Reporting
Crash Reporting
In-App Chat
In-App Surveys
Feature Requests
  • ✅ Stable
  • ⚙️ Under active development

Integration #

Installation #

  1. Add Instabug to your pubspec.yaml file.
dependencies:
      instabug_flutter:
  1. Install the package by running the following command.
flutter packages get

Initializing Instabug #

To start using Instabug, import it into your Flutter app.

import 'package:instabug_flutter/Instabug.dart';
  • iOS

    Initialize the SDK in initState(). This line enables the SDK with the default behavior and sets it to be shown when the device is shaken.
Instabug.start('APP_TOKEN', [InvocationEvent.shake]);
  • Android

  1. Add the following Maven repository to your project level build.gradle
allprojects {
	repositories {
	    maven {
	        url "https://sdks.instabug.com/nexus/repository/instabug-cp"
	    }
	}
}
  1. Create a new Java class that extends FlutterApplication and add it to your AndroidManifest.xml.
<application
    android:name=".CustomFlutterApplication"
    ...
</application>
  1. In your newly created CustomFlutterApplication class, override onCreate() and add the following code.
ArrayList<String> invocationEvents = new ArrayList<>();
invocationEvents.add(InstabugFlutterPlugin.INVOCATION_EVENT_SHAKE);
new InstabugFlutterPlugin().start(CustomFlutterApplication.this, "APP_TOKEN", invocationEvents);

Crash reporting #

Instabug automatically captures every crash of your app and sends relevant details to the crashes page of your dashboard. Crashes are reported only when the app is running in release mode

  1. To start using Crash reporting, import the following into your main.dart.
import 'package:instabug_flutter/CrashReporting.dart';
  1. Replace void main() => runApp(MyApp()); with the following snippet:
void main() async {
  FlutterError.onError = (FlutterErrorDetails details) {
    Zone.current.handleUncaughtError(details.exception, details.stack);
  };
  runZoned<Future<void>>(() async {
    runApp(MyApp());
  }, onError: (dynamic error, StackTrace stackTrace) {
    CrashReporting.reportCrash(error, stackTrace);
  });
}

With Flutter 1.17 use this snipped instead:

void main() async {
  FlutterError.onError = (FlutterErrorDetails details) {
    Zone.current.handleUncaughtError(details.exception, details.stack);
  };
  runZonedGuarded<Future<void>>(() async {
  runApp(CrashyApp());
    }, (Object error, StackTrace stackTrace) {
        CrashReporting.reportCrash(error, stackTrace);
    });
}

Network Logging #

You can choose to attach all your network requests to the reports being sent to the dashboard. To enable the feature when using the dart:io package HttpClient, use the custom Instabug client:

InstabugCustomHttpClient client = InstabugCustomHttpClient();

and continue to use the package normally to make your network requests:

client.getUrl(Uri.parse(URL)).then((request) async {
      var response = await request.close();
});

We also support the packages http and dio. For details on how to enable network logging for these external packages, refer to the Instabug Dart Http Adapter and the Instabug Dio Interceptor repositories.

Microphone and Photo Library Usage Description (iOS Only) #

Instabug needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that don’t provide a usage description for those 2 permissions would be rejected when submitted to the App Store.

For your app not to be rejected, you’ll need to add the following 2 keys to your app’s info.plist file with text explaining to the user why those permissions are needed:

  • NSMicrophoneUsageDescription
  • NSPhotoLibraryUsageDescription

If your app doesn’t already access the microphone or photo library, we recommend using a usage description like:

  • "<app name> needs access to the microphone to be able to attach voice notes."
  • "<app name> needs access to your photo library for you to be able to attach images."

The permission alert for accessing the microphone/photo library will NOT appear unless users attempt to attach a voice note/photo while using Instabug.

39
likes
0
pub points
92%
popularity

Publisher

verified publisherinstabug.com

Instabug is an in-app feedback and bug reporting tool for mobile apps. With just a simple shake, your users or beta testers can report bugs or send in-app feedback and the SDK will capture an environment snapshot of your user's device including all console logs, server-side network requests and bug reproduction steps compiling all these details in one organised dashboard to help you debug and fix bugs faster.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

flutter, meta, stack_trace

More

Packages that depend on instabug_flutter