Beispiel #1
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);
        }