Skip to content

Question about proper way to deal with notification actions #428

Closed Answered by ne0rrmatrix
ne0rrmatrix asked this question in Q&A
Discussion options

You must be logged in to vote

Well I figured it out!

default:
                if (message.Cancel)
                {
                    LocalNotificationCenter.Current.Cancel(e.Request.NotificationId);
                    break;
                }
                if (e.Request.Cancel())
                {
                    LocalNotificationCenter.Current.Cancel(e.Request.NotificationId);
                    break;
                }

The above code works for me in simulator. Fingers crossed it works on physical devices. If I clear all notifications using button in notification drawer it does not launch all the default actions below those lines. Which is what I intended. Glad I caught that before pushing to production!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ne0rrmatrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant