public int finishNewDeviceRegistration(String code, String signalingKey, bool supportsSms, bool fetchesMessages, int registrationId, String deviceName)
        {
            ConfirmCodeMessage javaJson     = new ConfirmCodeMessage(signalingKey, supportsSms, fetchesMessages, registrationId, deviceName);
            string             json         = JsonUtil.toJson(javaJson);
            string             responseText = makeRequest(string.Format(DEVICE_PATH, code), "PUT", json);
            DeviceId           response     = JsonUtil.fromJson <DeviceId>(responseText);

            return(response.deviceId);
        }
示例#2
0
        public async Task <int> FinishNewDeviceRegistration(CancellationToken token, String code, String signalingKey, bool supportsSms, bool fetchesMessages, int registrationId, String deviceName)
        {
            ConfirmCodeMessage javaJson     = new ConfirmCodeMessage(signalingKey, supportsSms, fetchesMessages, registrationId, deviceName);
            string             json         = JsonUtil.ToJson(javaJson);
            string             responseText = await MakeServiceRequestAsync(token, string.Format(DEVICE_PATH, code), "PUT", json);

            DeviceId response = JsonUtil.FromJson <DeviceId>(responseText);

            return(response.NewDeviceId);
        }