/// <summary>
        /// Store the latest know token
        /// </summary>
        /// <param name="token"></param>
        private async void registerAsync(string token)
        {
            AddLog(string.Format("GCM: Push Notification - Device Registered - Token : {0}", token));
            var  Id       = UsefulBits.GetDeviceID();
            bool bSuccess = await ApiService.RegisterDevice(Id, token);

            if (bSuccess)
            {
                AddLog("GCM: Device registered on Domoticz");
            }
            else
            {
                AddLog("GCM: Device not registered on Domoticz");
            }
        }
Exemple #2
0
        private async void registerAsync(String token)
        {
            tokenUploaded = true;
            Domoticz.App.AddLog(string.Format("GCM: Push Notification - Device Registered - Token : {0}", token));
            String Id       = UsefulBits.GetDeviceID();
            bool   bSuccess = await Domoticz.App.ApiService.RegisterDevice(Id, token);

            if (bSuccess)
            {
                Domoticz.App.AddLog("GCM: Device registered on Domoticz");
            }
            else
            {
                Domoticz.App.AddLog("GCM: Device not registered on Domoticz");
            }
        }