locked
Using APNS and Firebase Cloud Messaging Unable To Cancel Or Remove Pending Notifications RRS feed

  • Question

  • User35228 posted

    Hey Xamarin,

    I am attempting to remove a pending notification. I have found then when I use

    Notification { title: '', body: '' }

    as the method of delivering the notification, I can cancel it by using RemoveAllPendingNotifications. However the notification doesn't work in background mode or when the device was restarted.

    I instead am using:

    APNS: { content-available: 1, alert: { title: '', body: '' } }

    This works perfectly in all cases however I am unable to remove or cancel the pending notification. I think this could be because it automatically displays the notification instead of me having to display it in code.

    I need to continue using the APNS as it solves some necessary feature requests of my app, however I also need the ability to cancel the message.

    Thanks, Jacob

    Thursday, July 12, 2018 6:49 AM

All replies

  • User369978 posted

    Have you tried UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; to cancel all the notifications?

    Friday, July 20, 2018 7:39 AM
  • User35228 posted

    Yup I tried that, doesn't clear missed notifications from the lock screen sadly :(

    Friday, July 20, 2018 7:29 PM