Merge pull request #97 from FRE-Informatica/crashlytics/rollback
Crashlytics/rollback
This commit is contained in:
commit
1f04e7e5ff
|
@ -50,31 +50,32 @@ void _initializeUrlStrategy() {
|
|||
|
||||
Future<void> _initializeSystemSettings() async {
|
||||
print('Initializing System Settings...');
|
||||
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
||||
|
||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
||||
|
||||
if (kDebugMode) {
|
||||
print('Debug mode');
|
||||
// await crashlyticsInstance.setCrashlyticsCollectionEnabled(false);
|
||||
await crashlyticsInstance.setCrashlyticsCollectionEnabled(false);
|
||||
} else {
|
||||
print('Release mode');
|
||||
// await crashlyticsInstance.setCrashlyticsCollectionEnabled(true);
|
||||
|
||||
// Verifica e envia relatórios não enviados de forma assíncrona
|
||||
// crashlyticsInstance.checkForUnsentReports().then((unsentReports) {
|
||||
// if (unsentReports) {
|
||||
// crashlyticsInstance.sendUnsentReports();
|
||||
// print('Existem relatórios de falhas não enviados.');
|
||||
// } else {
|
||||
// print('Todos os relatórios de falhas foram enviados.');
|
||||
// }
|
||||
// }).catchError((error) {
|
||||
// print('Erro ao verificar ou enviar relatórios não enviados: $error');
|
||||
// });
|
||||
await crashlyticsInstance.setCrashlyticsCollectionEnabled(true);
|
||||
if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
|
||||
// Configura o tratamento de erros não capturados
|
||||
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
||||
|
||||
// Configura o tratamento de erros não capturados
|
||||
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
||||
crashlyticsInstance.checkForUnsentReports().then((unsentReports) {
|
||||
if (unsentReports) {
|
||||
crashlyticsInstance.sendUnsentReports();
|
||||
print('Existem relatórios de falhas não enviados.');
|
||||
} else {
|
||||
print('Todos os relatórios de falhas foram enviados.');
|
||||
}
|
||||
}).catchError((error) {
|
||||
print('Erro ao verificar ou enviar relatórios não enviados: $error');
|
||||
});
|
||||
}
|
||||
print('Crashlytics enabled');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue