Creating a local notification in response to a push notification (from firebase) in cordova/ionic : <p>I'm building an application using Ionic Framework that implements a chat function similar to good-old facebook messenger, in that i want to notify users of a chat message, but if they view it elsewhere, i want to remove the notification from their home screen.</p>

<p>I'm using firebase as a back-end for push notifications (though that could be changed i suppose).</p>

<p>I know that you can't expire a remote notification, but i've been told you can expire + remove a local notification, so my question is - <strong>can i reliably receive a remote notification, create a local one, and display that, and then in response to a notification with a scope of 'expire' or 'remove', delete a local notification so that my users don't see a duplication of information?</strong></p>

<p>Most plugins tend to detect the status of the app and add a remote notification to the homescreen with the info you've pushed by default, is there a way to avoid this?</p>

<p>Thanks guys.</p>

<p>EDIT:
- Local notifications: <a href="http://ionicframework.com/docs/native/local-notifications/" rel="noreferrer">http://ionicframework.com/docs/native/local-notifications/</a>
- Firebase cloud messaging: <a href="https://github.com/fechanique/cordova-plugin-fcm" rel="noreferrer">https://github.com/fechanique/cordova-plugin-fcm</a></p>
