I'm trying to create application for Android and iOS and I want to use push notification on both the application. I'm going to have a server app that will be sending the notification.
What I'm trying to figure out is how we can store the device of the user so I'll know which service need to be used APNS or GCM.
One of the directions is to get the phone type to be set by the app and store this information on the server side, but what happens if the user changes his phone from iOS to Android, need to involve data storage of the user and collect information for every user, not covers scenario when user has Android tablet and iOS phone.
Make it more generic and dispatch the notification to both services APNS and GCM at the same time, one of them will return error?
Would love to hear what is the best practice for such scenarios?