You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NativeScript IOS Apps Broadcast as iPad in UserAgent String EVEN on iPhone Using http.getJSON() #2714
Please tell us how to recreate the issue in as much detail as possible.
RUN:
http.getJSON("http://exmplesite.com") in the app code, run it on an iPhone device or IOS iPHone simulator.
Look at the access log of exmplesite.com, you'll see the UserAgent String looks something like:
"Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25""Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25"
Where "iPad" is shown, this should be "iPhone". (When loading a webview, the user agent string is correct from an iPhone, so it appears the issue is NOT happen on a webview, but IS happening using the http.getJSON() function.)
Activity
NickIliev commentedon Sep 14, 2016
Hello @newmediaone
Indeed the http module is setting the user-agent as iPad.
You can however, send your own custom user agent.
e.g.
Of course, you can provide some meaningful information in your user-agent string using this
NickIliev commentedon Sep 15, 2016
Related to https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/http/http-request.ios.ts#L18
E-Mwaurer commentedon Jun 25, 2019
How do i get the user agent details of my cross platform app built with nativescript. Any help is highly appreciated
lock commentedon Jun 24, 2020
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.