refactor apns notification method to not make an unnecessary call to the database