updated push registration code to take a callback parameter