11using CommunityToolkit . Maui ;
2+ using CommunityToolkit . Maui . Alerts ;
23using CommunityToolkit . Maui . ApplicationModel ;
34using CommunityToolkit . Maui . Extensions ;
45using CommunityToolkit . Maui . Views ;
@@ -155,15 +156,6 @@ protected override void OnStart()
155156
156157 }
157158
158- IFirebasePushNotification . Current . RegisterNotificationCategories ( new [ ]
159- {
160- new NotificationCategory ( "daily_catchup" , new [ ]
161- {
162- new NotificationAction ( "open_in_app" , "Open in the app" , NotificationActionType . Foreground ) ,
163- new NotificationAction ( "open_in_browser" , "Open in the browser" , NotificationActionType . Foreground ) ,
164- } )
165- } ) ;
166-
167159 // Reset notificaiton badges
168160 Badge . Default . SetCount ( 0 ) ;
169161#if __IOS__
@@ -274,7 +266,7 @@ protected override void OnResume()
274266 /// </summary>
275267 /// <param name="popUp">pop up to open</param>
276268 /// <param name="page">parent page</param>
277- public void OpenPopUp ( Popup popUp , Page page = null )
269+ public void OpenPopUp ( Popup popUp , Page page = null , bool bgTapToClose = true )
278270 {
279271 try
280272 {
@@ -286,14 +278,15 @@ public void OpenPopUp(Popup popUp, Page page = null)
286278 page = Shell ;
287279 if ( page . Navigation . NavigationStack . Any ( p => p ? . Id == popUp ! . Id ) )
288280 return ;
289- MainThread . BeginInvokeOnMainThread ( async ( ) => await page . ShowPopupAsync ( popUp , options : new PopupOptions ( )
290- {
291- Shape = new RoundRectangle
281+ MainThread . BeginInvokeOnMainThread ( async ( ) => await page . ShowPopupAsync ( popUp , options : new PopupOptions ( )
292282 {
293- StrokeThickness = 0
294- }
295- } ) ) ;
296- }
283+ CanBeDismissedByTappingOutsideOfPopup = bgTapToClose ,
284+ Shape = new RoundRectangle
285+ {
286+ StrokeThickness = 0
287+ }
288+ } ) ) ;
289+ }
297290#if DEBUG
298291 catch ( Exception ex )
299292 {
@@ -307,6 +300,21 @@ public void OpenPopUp(Popup popUp, Page page = null)
307300#endif
308301 }
309302
303+ /// <summary>
304+ /// Display an error message as snack bar with a link to support email
305+ /// </summary>
306+ /// <param name="message">error message to be displayed</param>
307+ public static async Task DisplaySoftError ( string message )
308+ {
309+
310+ await Snackbar . Make ( message ,
311+ ( ) =>
312+ {
313+ Email . ComposeAsync ( subject : "" , body : "" , to : new string [ ] { "support@gamhub.io" } ) ;
314+ } ,
315+ actionButtonText : "contact support" ) . Show ( ) ;
316+ }
317+
310318 /// <summary>
311319 /// Setup the instance for a device
312320 /// </summary>
0 commit comments