Skip to content

Option to not open the app when notification is selected / clicked / tapped #469

Closed Answered by bryanp-ramosoil
flaubertagu asked this question in Q&A
Discussion options

You must be logged in to vote

I had the same problem. You need to tap into the LifecycleEvents. Here's what I did to get around the issue. I'm pretty sure that's all you will need. Sorry but I couldn't find the original post where I found this solution. Hope this helps.

Add this to MauiProgram.cs

            .ConfigureLifecycleEvents(lifecycle =>
            {
#if WINDOWS
                // This is needed to ensure a single instance of the application
                lifecycle.AddWindows(windows =>
                {
                    windows.OnAppInstanceActivated((sender, e) =>
                        HandleAppActions((e.Data as Windows.ApplicationModel.Activation.LaunchActivatedEventArgs)?.Arguments));
           …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@flaubertagu
Comment options

Answer selected by flaubertagu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants