Ionic Push Notification event handlers. Which to use?

For some unknown reason, $ionicPush doesn’t expose the finish() method. And the documentation is wrong - they have copied it directly from the documentation for the underlying plugin


but the plugin is wrapped by the angular service for ionic.

The solution is to get access to the plugin which we can see (by looking at the source code)


is available at $ionicPush.plugin. Also, the wrapper converts the 'notification' event to 'cloud:push:notification'

so basically, this solution works for me

      $rootScope.$on('cloud:push:notification', function(event, data) {
        var msg = data.message;
        console.log("data = "+JSON.stringify(data));

        if (data.raw.additionalData["content-available"] == 1) {
          console.log("Found silent push notification, for platform "+ionic.Platform.platform());
         // handle the notification and then...
          $ionicPush.plugin.finish(function(result) {
                 console.log("Finish successful with result " + result);
               }, function(error) {
                 console.log("Finish unsuccessful with result "+error);
               });
        };
     });

I was also really surprised that the documentation is incorrect and would strongly recommend that it be fixed ASAP.
@max