I am sending JSON data from Android & iPhone apps to my web2py application.
I have also written an 'm' page that is accessible from Android & iPhone platforms that also makes the same JSON calls.
I understand how to determine if the request is from Android or iOS using the web2py utility request.user_agent()
.
I have observed these signatures in the http_user_agent
:
"Bundle%20name/1.400.130508 CFNetwork/609.1.4 Darwin/13.0.0" (iOS app)
"Apache-HttpClient/UNAVAILABLE (java 1.4)" (android app)
Is there some python module or comprehensive regexp available to determine if a call is coming from a phone app or a from a browser?