How to take device token for saving to db?

i want to save the device token to mysql db for sending notifications to users.How to do that??