Firstly I would like to thank you guys for providing such a wonderful library. This has indeed helped is delivering our users better user experience.
We have incorporated your library in our app. But recently we are facing a particular crash. The stack trace is as follows:
System.NullReferenceException: Object reference not set to an instance of an object.
We are using the following code to display the toast. Even though we have used a try catch, its not being handled.
ToastPrompt toast = new ToastPrompt();
toast.Tag = param;
toast.Title = title;
// Toast ui doesn't appear correct when there is new line in text.
int indexOfNewLine = content.IndexOf(_newLineCharNonUnixPlatform);
if (indexOfNewLine < 0)
indexOfNewLine = content.IndexOf(_newLineCharUnixPlatform);
toast.Message = indexOfNewLine > 0 ? content.Substring(0, indexOfNewLine) : content;
toast.Foreground = new SolidColorBrush(Colors.White);
toast.Background = (SolidColorBrush)App.Current.Resources["Blue"];
toast.VerticalContentAlignment = VerticalAlignment.Center;
toast.ImageSource = Utilities.ImageUtility.Logo;
toast.MaxHeight = 60;
toast.Tapped += ToastTapped;
catch (Exception ex)
//Coding toolkit throws internal exception
Debug.WriteLine("ForegroundNotificationManager::GenerateInAppToast:Exception:" + ex.Message);
Could you help us in providing a fix for the null excpetion? Also guide us in how to handle this crash more gracefully?