DisplayAlert Not working on second call only on iOs

So I'm using this class to help my MV display Popups and it's working perfectly on Android and UWP, but on iOS it works only the first time the page is created, if I PopAsync the page and than put it back on the navigation stack, it stops working and does not throw any erros. It just does not display the DisplayAlert. This only happens on iOS, it works fine on Android and UWP.

public abstract class DisplayAlertMessagingCenter<T> 
        where T:class
    {
        public static string DisplayAlertMessageT = "DisplayAlertMessage";

        public static void Subscribe(Page page) 
        {
            System.Diagnostics.Debug.WriteLine(page+"Subscribed");
            MessagingCenter.Subscribe<T, DisplayAlertMessage>(page, DisplayAlertMessageT, 
                async(sender,message) => 
                {
                    var result = true;
                    System.Diagnostics.Debug.WriteLine("Received message");
                    if (!string.IsNullOrEmpty(message.Accept)){
                        System.Diagnostics.Debug.WriteLine("Display alert 1");
                        result = await page.DisplayAlert(message.Title, message.Message, message.Accept, message.Cancel);
                    }
                    else
                    {
                        System.Diagnostics.Debug.WriteLine("Display alert 2");
                        System.Diagnostics.Debug.WriteLine(page);
                        try
                        {
                            await page.DisplayAlert(message.Title, message.Message, message.Cancel);
                        }
                        catch (Exception ex)
                        {
                            System.Diagnostics.Debug.WriteLine(ex.Message);
                        }

                    }

                    message.OnCompleted?.Invoke(result);
                });
        }

        public static void Send(T sender, DisplayAlertMessage message)
        {
            MessagingCenter.Send(sender, DisplayAlertMessageT, message);
        }
}
Sign In or Register to comment.