Forum Xamarin.iOS

DisplayAlert disappearing after PopAsync on iOS

kenneth.leekenneth.lee USMember ✭✭✭

I have been coding my app in Xamarin.Form for a while now but I have recently found a bug I'm not too sure how to solve. I have this bit of code within an async button click ...

await navigation.PopAsync();
await navigation.PopAsync();
await navigation.PopAsync();
App.UserDialog.HideLoading();
await DisplayAlert("Error", response, "Ok");

On Android the user experience is the user gets popped 3 pages back and then get the error alert display - which is what I intend the UX to be. However on iOS i just get the triple pop and no alert. It looks almost like the alert is displaying but it just closes immediately. I'm aware that iOS and Android DisplayAlert calls their native versions of it respectively and have different implementations so my mind is currently towards that idea and am thinking of using a more consistent popup display like Rg.Plugins.Popup. The code that I've written bugs me cause I feel like I'm doing it at wrong. With calling PopAsync 3 times in a row it just feels almost hacky.

Does anyone has any ideas on what I'm doing wrong or know if the only work around is using Rg.Plugins.Popup?

Best Answer

  • kenneth.leekenneth.lee USMember ✭✭✭
    Accepted Answer

    i ended up using ACR User Dialogs (since i already had it) and it seems to implement display alert similarly to how I expect the UX to be.

    await App.UserDialog.AlertAsync(response, "SecureShare", "Ok");
    

Answers

  • kenneth.leekenneth.lee USMember ✭✭✭
    Accepted Answer

    i ended up using ACR User Dialogs (since i already had it) and it seems to implement display alert similarly to how I expect the UX to be.

    await App.UserDialog.AlertAsync(response, "SecureShare", "Ok");
    
Sign In or Register to comment.