Implement FCM [WIP]
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -18,6 +19,8 @@ class Globals {
|
||||
String buildNumber = '';
|
||||
String platform = '';
|
||||
String hostname = '';
|
||||
String clientType = '';
|
||||
String deviceModel = '';
|
||||
|
||||
late SharedPreferences sharedPrefs;
|
||||
|
||||
@@ -31,6 +34,25 @@ class Globals {
|
||||
this.platform = Platform.operatingSystem;
|
||||
this.hostname = Platform.localHostname;
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
this.clientType = 'ANDROID';
|
||||
this.deviceModel = (await DeviceInfoPlugin().androidInfo).model;
|
||||
} else if (Platform.isIOS) {
|
||||
this.clientType = 'IOS';
|
||||
this.deviceModel = (await DeviceInfoPlugin().iosInfo).model;
|
||||
} else if (Platform.isLinux) {
|
||||
this.clientType = 'LINUX';
|
||||
this.deviceModel = (await DeviceInfoPlugin().linuxInfo).prettyName;
|
||||
} else if (Platform.isWindows) {
|
||||
this.clientType = 'WINDOWS';
|
||||
this.deviceModel = (await DeviceInfoPlugin().windowsInfo).productName;
|
||||
} else if (Platform.isMacOS) {
|
||||
this.clientType = 'MACOS';
|
||||
this.deviceModel = (await DeviceInfoPlugin().macOsInfo).model;
|
||||
} else {
|
||||
this.clientType = '?';
|
||||
}
|
||||
|
||||
this.sharedPrefs = await SharedPreferences.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user