Bug 35737 - DisplayAlert messages being ignored or not shown
Summary: DisplayAlert messages being ignored or not shown
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.2
Hardware: All Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-10 10:30 UTC by Paul Johnson
Modified: 2016-04-13 18:34 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Paul Johnson 2015-11-10 10:30:32 UTC
I have a ContentPage that pulls from a database a list of strings. If the count is zero, a DisplayAlert is thrown. The alert shows on Android, but not on iOS. Typically, this is from either a return from an async call (say to a web service) or if the ContentPage is Pop'd back before it is shown.

Example 1

(calling page)

btnClicked += async delegate
{
    await Navigation.PushAsync(new SecondPage());
}

(second page)

var data = App.Self.DBManager.GetListOfObjects<MyDataClass, string>("some_param", search_param);
if (data.Count == 0)
{
     await DisplayAlert("Data error", "You have no data", "OK", "");
     await Navigation.PopAsync();
}

(Alert shows on Android, not on iOS)

Example 2

btnTakePic.Clicked += async delegate
            {
                await media.TakePhotoAsync(new CameraMediaStorageOptions { DefaultCamera = CameraDevice.Front, MaxPixelDimension = 400 }).ContinueWith(async t =>
                    {
                        if (t.IsFaulted)
                        {
                            var s = t.Exception.InnerException.ToString();
                        }
                        else if (t.IsCanceled)
                        {
                            var canceled = true;
                        }
                        else
                        {
                            var mediaFile = t.Result;
                            var res = await SendData.HttpPost(mediaFile, App.Self.Settings.GetSetting<string>("token"), userProfile.xACCid, folderid);
                            if (res)
                            {
                                var files = new FilesBase();
                                var newfile = await Networking.WebServiceForData(files, "files");
                                if (newfile != null)
                                {
                                    foreach (var f in newfile.files)
                                        App.Self.obsFiles.Add(f);
                                    App.Self.DBManager.AddOrUpdateFiles(newfile.files);
                                    var thanks = new FileUploaded
                                    {
                                        IsClippedToBounds = true
                                    };
                                    stackLayout.Children.Add(thanks);
                                }
                            }
                            else
                                await DisplayAlert("File upload error", "The selected file has failed to upload", "OK", "");
                            return mediaFile;
                        }
                        return null;
                    }, scheduler);
            };

(the res condition is hit as the service returns virtually instantly with false) however the DisplayAlert never shows. Adding Device.BeginInvoke makes no difference. Adding .ConfigureAwait(true or false) makes no difference

Both examples work fine on Android (and the first on WinPhone)

=== Xamarin Studio ===

Version 5.10 (build 860)
Installation UUID: 728e2a5d-c6a2-4d84-a931-ee64cb78694c
Runtime:
	Mono 4.2.1 (explicit/8862921)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010091

=== Xamarin.Profiler ===

Version: 0.18.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.Mac ===

Version: 2.4.0.105 (Starter Edition)

=== Xamarin.Android ===

Version: 6.0.0.27 (Business Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.3.7
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: 9.2.1.21 (Business Edition)
Hash: 9ce9e8b
Branch: master
Build date: 2015-10-28 19:11:03-0400

=== Build Information ===

Release ID: 510000860
Git revision: 7c46a0b709d51ad5d5a5ed90a4671cc7b6928e62
Build date: 2015-10-29 17:17:52-04
Xamarin addins: b9337905aca5dc276190d78819728a59cda33a43
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.11.2
Darwin Pauls-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Oct 28 11:41:13 PDT 2015
    root:xnu-3248.20.42~5/RELEASE_X86_64 x86_64
Comment 1 E.Z. Hart [MSFT] 2015-11-18 11:07:48 UTC
Paul,

Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it.

Warm regards,
Xamarin Forms Team
Comment 2 Samantha Houts [MSFT] 2016-04-13 18:34:22 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team