TF-1248: add config support ios FCM to env.five

This commit is contained in:
ManhNTX
2022-12-08 07:34:27 +07:00
committed by Dat H. Pham
parent 015860a593
commit 8ae8a43697
2 changed files with 10 additions and 6 deletions
+1
View File
@@ -3,3 +3,4 @@ DOMAIN_REDIRECT_URL=http://localhost:3000
WEB_OIDC_CLIENT_ID=teammail-web
APP_GRID_AVAILABLE=supported
FCM_AVAILABLE=supported
IOS_FCM=unsupported
+8 -5
View File
@@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter_dotenv/flutter_dotenv.dart';
class AppConfig {
@@ -13,12 +15,13 @@ class AppConfig {
}
static String appDashboardConfigurationPath = "configurations/app_dashboard.json";
static bool get fcmAvailable {
final supported = dotenv.get('FCM_AVAILABLE', fallback: 'unsupported');
if (supported == 'supported') {
return true;
final supportedOtherPlatform = dotenv.get('FCM_AVAILABLE', fallback: 'unsupported');
final supportedIOSPlatform = dotenv.get('IOS_FCM', fallback: 'unsupported');
if (Platform.isIOS) {
return supportedIOSPlatform == 'supported';
} else {
return supportedOtherPlatform == 'supported';
}
return false;
}
static String appFCMConfigurationPath = "configurations/env.fcm";
}