Moved push notification code into an angular service