TF-2384 Store data to keychain when save new Account

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 4d84a3354927d1c0becaf0e8e6d7cc8c54721f58)
This commit is contained in:
dab246
2023-12-24 19:24:33 +07:00
committed by Dat H. Pham
parent 940cc2f315
commit a2a1f8246f
22 changed files with 211 additions and 238 deletions
@@ -1,6 +1,4 @@
import 'dart:io';
import 'package:core/domain/extensions/datetime_extension.dart';
import 'package:core/utils/app_logger.dart';
import 'package:core/utils/platform_info.dart';
@@ -94,38 +92,13 @@ class FcmUtils {
return object == null || (object is String && object.isEmpty);
}
String get platformOS {
var platformName = '';
if (PlatformInfo.isWeb) {
platformName = 'Web';
} else {
if (Platform.isAndroid) {
platformName = 'Android';
} else if (Platform.isIOS) {
platformName = 'IOS';
} else if (Platform.isFuchsia) {
platformName = 'Fuchsia';
} else if (Platform.isLinux) {
platformName = 'Linux';
} else if (Platform.isMacOS) {
platformName = 'MacOS';
} else if (Platform.isWindows) {
platformName = 'Windows';
}
}
log('FcmUtils::platformOS():$platformName');
return platformName;
}
String hashTokenToDeviceId(String token) {
final tokenHashCode = token.hashCode.toString();
final deviceId = '$hashCodeKey-$platformOS-$tokenHashCode';
final deviceId = '$hashCodeKey-${PlatformInfo.platformNameOS}-$tokenHashCode';
log('FcmUtils::hashCodeTokenToDeviceId():deviceId: $deviceId');
return deviceId;
}
bool get isMobileAndroid => PlatformInfo.isMobile && Platform.isAndroid;
bool checkExpirationTimeWithinGivenPeriod({
required DateTime expiredTime,
required DateTime currentTime,