How to clear push notification from Ionic Push?

The push notification clears when the user taps on the notification to open app. However if the user goes and opens the app, the push notification is still there. How can I get rid of the notification? I can't seem to find anywhere in the documentation that addresses this.

Thanks a lot in advance

I did some digging as I too had this problem, and it looks like a bug in the Push Plugin. Basically they added the removal code to the pause event instead of the resume event.

You just have to change the code in src/android/com/plugin/gcm/PushPlugin.java

from:

@Override
public void onPause(boolean multitasking) {
    super.onPause(multitasking);
    gForeground = false;
    final NotificationManager notificationManager = (NotificationManager) cordova.getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancelAll();
}

@Override
public void onResume(boolean multitasking) {
    super.onResume(multitasking);
    gForeground = true;
}

to:

@Override
public void onPause(boolean multitasking) {
    super.onPause(multitasking);
    gForeground = false;
}

@Override
public void onResume(boolean multitasking) {
    super.onResume(multitasking);
    gForeground = true;
    final NotificationManager notificationManager = (NotificationManager) cordova.getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancelAll();
}

This will create a more standard behaviour, where the notifications will be removed on app resume (instead of on pause). Note though, I haven't fully tested the effects on the internal app messages yet, which may require more changes.