Skip to content

Commit

Permalink
fix(initilization): fix the PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asamiz committed Jul 19, 2023
1 parent ba04510 commit b836710
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,14 @@ Initialize the SDK in your `main` function. This starts the SDK with the default
import 'package:instabug_flutter/instabug_flutter.dart';
void main() {
runZonedGuarded(
() {
WidgetsFlutterBinding.ensureInitialized();
Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
);
FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
},
CrashReporting.reportCrash,
Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
);
runApp(MyApp());
}
```

Expand All @@ -73,18 +64,23 @@ Instabug automatically captures every crash of your app and sends relevant detai

```dart
void main() {
WidgetsFlutterBinding.ensureInitialized();
runZonedGuarded(
() {
WidgetsFlutterBinding.ensureInitialized();
Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.floatingButton],
);
Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
);
FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};
FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};
runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
runApp(MyApp());
},
CrashReporting.reportCrash,
);
}
```

Expand Down

0 comments on commit b836710

Please sign in to comment.