Exemple #1
0
        private async Task <bool> SendFilePicToServer(string filePath, string name)
        {
            bool result = false;

            result =
                await _serverSendFile.SendGenericFileToServer(ServerConfig.Instance.server_url_send_pic, filePath, name);

            return(result);
        }
Exemple #2
0
        private async Task <bool> SendFileAudioToServerAndDelete(string filePath, string name, ServerSendFileCallback callback = null)
        {
            RequestBuilder requestBuilder = new RequestBuilder();

            requestBuilder
            .SetDevice_id(App.config.GetDeviceId())
            .SetDevice_tokenFirebase(App.firebaseInstanceId.Token);
            if (timerSpanToRecord != null)
            {
                requestBuilder.SetLength(timerSpanToRecord.ToString());
            }
            _serverSendFile.request = requestBuilder.Build();

            bool result =
                await _serverSendFile.SendGenericFileToServer(ServerConfig.Instance.server_url_send_audio, filePath, name, callback);

            result = result && await StorageUtility.DeleteFileLocalStorage(filePath);


            return(result);
        }