added le-r10-certificate and removed/added some logging
This commit is contained in:
@ -20,7 +20,7 @@ class NotifyRegister extends MhslApi<void> {
|
||||
@override
|
||||
Future<http.Response> request(Uri uri) {
|
||||
var requestString = jsonEncode(params.toJson());
|
||||
log(requestString);
|
||||
log('register at push proxy with username ${params.username}');
|
||||
return http.post(uri, body: requestString);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class UpdateUserIndex extends MhslApi<void> {
|
||||
@override
|
||||
Future<http.Response> request(Uri uri) {
|
||||
var data = jsonEncode(params.toJson());
|
||||
log('Updating userindex:\n $data');
|
||||
log('Updating userindex: ${data.length}');
|
||||
return http.post(uri, body: data);
|
||||
}
|
||||
|
||||
|
@ -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: [
|
||||
|
@ -24,6 +24,7 @@ class NotifyUpdater {
|
||||
NotifyUpdater.registerToServer();
|
||||
},
|
||||
);
|
||||
|
||||
static Future<void> registerToServer() async {
|
||||
var fcmToken = await FirebaseMessaging.instance.getToken();
|
||||
|
||||
|
Reference in New Issue
Block a user