I have to send Push Notification through java server, how can I detect the device is android or iOS?
Asked
Active
Viewed 943 times
0
-
while registering users or login service should also receive device_type . – Muhammad Adnan Mar 13 '15 at 19:59
-
What kind of push? GCM? SNS? APN? More info please. – JHH Mar 13 '15 at 20:01
-
For android GCM and for iOS APNS but in server side how i detect i have only device token. – Sukhmeet Hora Mar 13 '15 at 20:02
-
See if [this answer](http://stackoverflow.com/a/6770594/2055998) is of any help. – PM 77-1 Mar 13 '15 at 20:08
-
possible duplicate of [How to detect mobile (iOS and Android) using JSP/Java?](http://stackoverflow.com/questions/6770572/how-to-detect-mobile-ios-and-android-using-jsp-java) – Philipp Wendler Mar 13 '15 at 20:28
2 Answers
1
There is no magic to know device type by token. You have to send device_type while registering for push notification or login service . USE "ios" or "android" strings hardcoded for iphone and android against against device_type. Thats how you know which token is against which device. Send ios notifications via APNs or GCM to ios or android devices respectively

Muhammad Adnan
- 2,668
- 15
- 27
0
I have to send Push Notification through java server, how can I detect the device is android or iOS?
Well the implementation of push notifications in every platform is completely different! in both you don´t need to know the platform.

Jorgesys
- 124,308
- 23
- 334
- 268