WIP #471 Native FCM init
This commit is contained in:
@ -20,6 +20,7 @@ class AppSettings {
|
||||
String tempToken;
|
||||
String oauthUrl;
|
||||
String webhookId;
|
||||
String fcmToken;
|
||||
double haVersion;
|
||||
bool scrollBadges;
|
||||
int appIntegrationVersion;
|
||||
@ -40,6 +41,7 @@ class AppSettings {
|
||||
if (full) {
|
||||
Logger.d('Loading settings...');
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
fcmToken = prefs.getString('fcm-token');
|
||||
_domain = prefs.getString('hassio-domain');
|
||||
_port = prefs.getString('hassio-port');
|
||||
webhookId = prefs.getString('app-webhook-id');
|
||||
|
@ -12,7 +12,7 @@ class MobileAppIntegrationManager {
|
||||
"os_version": DeviceInfoManager().osVersion,
|
||||
"app_data": {
|
||||
"push_token": "",
|
||||
"push_url": "https://us-central1-ha-client-c73c4.cloudfunctions.net/pushNotifyV2"
|
||||
"push_url": "https://us-central1-ha-client-c73c4.cloudfunctions.net/pushNotifyV3"
|
||||
}
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@ class MobileAppIntegrationManager {
|
||||
static Future checkAppRegistration() {
|
||||
Completer completer = Completer();
|
||||
_appRegistrationData["device_name"] = AppSettings().mobileAppDeviceName ?? getDefaultDeviceName();
|
||||
(_appRegistrationData["app_data"] as Map)["push_token"] = "${HomeAssistant().fcmToken}";
|
||||
(_appRegistrationData["app_data"] as Map)["push_token"] = "${AppSettings().fcmToken}";
|
||||
if (AppSettings().webhookId == null) {
|
||||
Logger.d("Mobile app was not registered yet. Registering...");
|
||||
var registrationData = Map.from(_appRegistrationData);
|
||||
|
Reference in New Issue
Block a user