finotescore 0.0.1-dev.2 copy "finotescore: ^0.0.1-dev.2" to clipboard
finotescore: ^0.0.1-dev.2 copied to clipboard

Detect and report bugs in Flutter based mobile apps.

Finotes Core (finotescore) #

Flutter plugin with the ability to detect and report bugs in Android mobile apps (iOS will be supported in future).

Prerequisites for Integration #

Plugin supports dart SDK versions greater than or equal to 2.16.2 and less than 3.0.0. Flutter version should be greater than or equal to 2.5.0.

How to Integrate #

Add finotescore to pubspec.yaml file.

dependencies:
  finotescore: 0.0.1

Initializing Finotes #

Call Fn.init() function within the main function. Make sure to call WidgetsFlutterBinding.ensureInitialized() before calling init API.

void main() {
    runApp(const MyApp());

    WidgetsFlutterBinding.ensureInitialized();
    Fn.init();

}

Setting Proguard Rules #

If you are using proguard in release build, you need to add the following to the proguard-rules.pro file.

proguard-rules.pro:

-keep class com.finotes.android.finotescore.* { *; }

-keepclassmembers class * {
    @com.finotes.android.finotescore.annotation.Observe *;
}

Add below line to keep the exact line number and source file name in the stacktrace.

proguard-rules.pro:

-keepattributes SourceFile,LineNumberTable

Please make sure that the mapping file of production build (each build) is backed up, inorder to deobfuscate the stacktrace from Finotes dashboard. Location of mapping file: project-folder/app/build/outputs/proguard/release/mapping.txt

Testing Integration #

Now that the basic integration of Finotes plugin is complete, Let us make sure that the dashboard and plugin are in sync.

Step One

Add Fn.test() under Fn.init

void main() {
    runApp(const MyApp());

    WidgetsFlutterBinding.ensureInitialized();
    Fn.init();

    Fn.test(); //Line to raise test issue.
}

Step Three

Once the application opens up, open Finotes dash. The test issue that we raised should be reported.

Remember to remove the Fn.test() call, else every time the app is run, an issue will be reported.

Crash Reporting #

With basic integration, Finotes will track and report uncaught exceptions to Finotes dashboard automatically.

Report GuardedZone Errors #

Any exceptions that may have already been caught within the Zone needs to be reported as they might prevent the application from crashing, but at the same time can make app unstable if gone unreported.

    runZonedGuarded<Future<void>>(() async {
      
        ....

    }, (dynamic error, StackTrace stackTrace) {
        Fn.reportError(error, stackTrace); //Single line API to report caught errors. 
    });

Report Custom Issues #

Report custom issues using the Fn.reportIssue() API.

    Fn.reportIssue("Main App", "Payment failed", "Payment failed when selecting basic package");

Track UI block issues #

This feature is automatically activated in the plugin. With basic integration Finotes will track and report UI/ Main thread blocks that can lead to App Not Responding (ANR) situations automatically.

Activity Trail #

Activity markers are events that occur in an application during runtime. In order to capture lifecycle events of states used in the application, extend the State class from custom class FnState provided along with the plugin.

class _MyAppState extends FnState<MyApp> { //Replace State class with FnState class.
    ....

    @override
    Widget build(BuildContext context) {
        super.build(context); //Make sure to call the super here.
        return ..
    }
}

Settings custom activity trail #

Developers can set custom activity trail markers anywhere in the app using Fn.setActivityMarker(). These markers will be shown along with the lifecycle events, when an issue is reported.

    Fn.setActivityMarker("Main App", "User tapped on payment button");

Enable Finotes Logs #

You can activate internal Finotes logging using logMe() API. Activating logMe() API will print all logs generated by the plugin including error and warning logs.

    Fn.logMe();

When preparing for production release, make sure to remove the log API.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Detect and report bugs in Flutter based mobile apps.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, stack_trace

More

Packages that depend on finotescore