Unknown User-Agent that cannot be detected as Android or iOS #6772
-
Hi community,
We have developed a mobile app using Ionic and Capacitor. Works awesome and it's in production already. Our backend members have been developer a way to detect if the requests is being made from a mobile app or a browser. They categorize in the case of mobile, if it's Android or iOS by checking the User-Agent HTTP header. We have noticed a specific User-Agent that cannot be detected as Android/iOS. All we have in this case is the Origin that says I know that some User-Agent are reused across different platforms and browsers that cannot tell more information about the device. Maybe this is one case? Any push on this topic would be appreciated. Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
iPads by default have a desktop user agent instead of a mobile one
You could also append your app name to the user agent so it's easier for the backend members to detect it's the mobile app by using
can also be used inside |
Beta Was this translation helpful? Give feedback.
iPads by default have a desktop user agent instead of a mobile one
You can force them to use a mobile user agent by using
preferredContentMode
config option in capacitor config file like this:You could also append your app name to the user agent so it's easier for the backend members to detect it's the mobile app by using
appendUserAgent
like this:can also be used inside
android
object to append it to Android, or in the root so it's appended to both iOS and Android.