TF-1248: add config support ios FCM to env.five
This commit is contained in:
@@ -2,4 +2,5 @@ SERVER_URL=http://localhost/
|
|||||||
DOMAIN_REDIRECT_URL=http://localhost:3000
|
DOMAIN_REDIRECT_URL=http://localhost:3000
|
||||||
WEB_OIDC_CLIENT_ID=teammail-web
|
WEB_OIDC_CLIENT_ID=teammail-web
|
||||||
APP_GRID_AVAILABLE=supported
|
APP_GRID_AVAILABLE=supported
|
||||||
FCM_AVAILABLE=supported
|
FCM_AVAILABLE=supported
|
||||||
|
IOS_FCM=unsupported
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
|
||||||
class AppConfig {
|
class AppConfig {
|
||||||
@@ -13,12 +15,13 @@ class AppConfig {
|
|||||||
}
|
}
|
||||||
static String appDashboardConfigurationPath = "configurations/app_dashboard.json";
|
static String appDashboardConfigurationPath = "configurations/app_dashboard.json";
|
||||||
static bool get fcmAvailable {
|
static bool get fcmAvailable {
|
||||||
final supported = dotenv.get('FCM_AVAILABLE', fallback: 'unsupported');
|
final supportedOtherPlatform = dotenv.get('FCM_AVAILABLE', fallback: 'unsupported');
|
||||||
if (supported == 'supported') {
|
final supportedIOSPlatform = dotenv.get('IOS_FCM', fallback: 'unsupported');
|
||||||
return true;
|
if (Platform.isIOS) {
|
||||||
|
return supportedIOSPlatform == 'supported';
|
||||||
|
} else {
|
||||||
|
return supportedOtherPlatform == 'supported';
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
static String appFCMConfigurationPath = "configurations/env.fcm";
|
static String appFCMConfigurationPath = "configurations/env.fcm";
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user