Android analytics done, camera instructions added.

This commit is contained in:
Ivan Murashov
2018-04-22 18:43:29 +03:00
parent be4f2dc7cf
commit bc02327b3e
42 changed files with 1015 additions and 1386 deletions

View File

@@ -83,9 +83,10 @@ class _SplashScreenState extends BaseState<SplashScreen> {
} else if (token != null) {
_initAndStartScanner(context, app, token, helper);
} else {
print('Произошла непредусмотренная ошибка в логике приложения');
helper.getToken().then((token) {
_initAndStartScanner(context, app, token, helper);
platform.invokeMethod('logError', {"message":"Token is null"}).then((_) {
helper.getToken().then((token) {
_initAndStartScanner(context, app, token, helper);
});
});
}
});
@@ -103,8 +104,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
if (await platform.invokeMethod('isOnline')) {
getCheckTokenStatusRequest(token).then((statusResponse) {
handleStatusResponse(statusResponse, helper);
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
}
@@ -153,8 +154,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
} else if (response.statusCode == 201) {
clearToken(response, helper);
}
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
@@ -164,9 +165,11 @@ class _SplashScreenState extends BaseState<SplashScreen> {
Map parsedMap = JSON.decode(response.body);
getDeleteTokenRequest(parsedMap['token']).then((_) {
showNextScreen(new RegistrationScreen(helper, app));
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
@@ -257,7 +260,11 @@ class _SplashScreenState extends BaseState<SplashScreen> {
.value
.toString();
platform.invokeMethod('startScanner', args);
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
}