private IEnumerator _SendResponse() { AlertsService.makeLoadingAlert("Enviando resposta"); int currentUserId = UserService.user._id, missionId = MissionsService.mission._id, groupId = GetSelectedGroupId(senderTypeDropdown.captionText.text); WWW responseRequest = MissionsService.SendResponse(currentUserId, missionId, groupId); while (!responseRequest.isDone) { yield return(new WaitForSeconds(0.1f)); } Debug.Log("Header: " + responseRequest.responseHeaders["STATUS"]); Debug.Log("Text: " + responseRequest.text); AlertsService.removeLoadingAlert(); if (responseRequest.responseHeaders["STATUS"] == HTML.HTTP_200) { Mission currentMission = MissionsService.mission; if (currentMission.end_message != null && currentMission.end_message.Length > 0) { OpenModal("Final"); } else { AlertsService.makeAlert("Resposta enviada", "", ""); //AlertsService.makeAlert("Resposta enviada", "Boa! Sua resposta foi enviada com sucesso. Você será redirecionado(a) para as missões.", ""); yield return(new WaitForSeconds(5f)); LoadView("Missions"); } } else { if (responseRequest.responseHeaders["STATUS"] == HTML.HTTP_400) { AlertsService.makeAlert("Senha incorreta", "Por favor, verifique se inseriu corretamente o e-mail e senha.", "OK"); } else if (responseRequest.responseHeaders["STATUS"] == HTML.HTTP_404 || responseRequest.responseHeaders["STATUS"] == HTML.HTTP_401) { AlertsService.makeAlert("Usuário não encontrado", "Por favor, verifique se inseriu corretamente o e-mail e senha.", "OK"); } else { AlertsService.makeAlert("Falha na conexão", "Tente novamente mais tarde.", "Entendi"); } } yield return(null); }