added le-r10-certificate and removed/added some logging
This commit is contained in:
@ -34,22 +34,27 @@ import 'view/login/login.dart';
|
||||
import 'widget/placeholderView.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
log('MarianumMobile started');
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
addCertificateAsTrusted(ByteData certificate) => SecurityContext.defaultContext.setTrustedCertificatesBytes(certificate.buffer.asUint8List());
|
||||
|
||||
var initialisationTasks = [
|
||||
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)
|
||||
.then((value) async => log("Firebase token: ${await FirebaseMessaging.instance.getToken() ?? "Error: no Firebase token!"}"))
|
||||
.onError((error, stackTrace) => log('Error initializing Firebase: $error')),
|
||||
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem')
|
||||
.then((certificate) => SecurityContext.defaultContext.setTrustedCertificatesBytes(certificate.buffer.asUint8List())),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
|
||||
|
||||
Future(() async {
|
||||
await HydratedStorage.build(storageDirectory: await getTemporaryDirectory()).then((storage) => HydratedBloc.storage = storage);
|
||||
})
|
||||
];
|
||||
|
||||
log('starting app initialisation...');
|
||||
await Future.wait(initialisationTasks);
|
||||
log('app initialisation done!');
|
||||
|
||||
if(kReleaseMode) {
|
||||
ErrorWidget.builder = (error) => PlaceholderView(
|
||||
@ -58,6 +63,7 @@ Future<void> main() async {
|
||||
);
|
||||
}
|
||||
|
||||
log('running app...');
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
|
Reference in New Issue
Block a user