Plugin.FirebasePushNotifications icon indicating copy to clipboard operation
Plugin.FirebasePushNotifications copied to clipboard

[Enhancement] UNNotificationPresentationOptions for iOS

Open banditoth opened this issue 4 months ago • 8 comments

Summary

The CrossGeeks nuget have option to set the UNNotificationPresentationOptions on iOS. This version is not supporting it yet.

FirebasePushNotificationManager.ShouldShowWhen = UNNotificationPresentationOptions.Alert;

API Changes

I would propose to do it like custom options on Android on the apphostbuilder extension method.

            .UseFirebasePushNotifications(options =>
            {
                //options.AutoInitEnabled = false;
                options.AutoInitEnabled = true;
#if IOS
                options.iOS.PresentationOptions = UNNotificationPresentationOptions.Alert;
#endif
#if ANDROID
                options.Android.NotificationActivityType = typeof(MainActivity);
                options.Android.NotificationChannels  = new Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannelRequest[]
                {
                    new Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannelRequest()
                    {
                        ChannelId = "default_channel_id",
                        ChannelName = "Default Channel",
                        Description = "The default notification channel",
                        LockscreenVisibility =  Android.App.NotificationVisibility.Public,
                        Importance = Android.App.NotificationImportance.High,
                        IsDefault = true,
                    }
                };
#endif
``` -->

banditoth avatar Oct 02 '24 12:10 banditoth