I tried this (Page Not Found — Xojo documentation) and that
but both failed and i don’t know what i do wrong.
Using my iphone 6s plus and i got “Macintosh”, instead of iPhone… The secong gives “Unknown”!
Anyway to compare width and height screen size and use it instead of platformtype ?
Select Case Session.Platform
MsgBox("Unknown platform type")
Dim p As WebSession.PlatformType = session.Platform
If p = WebSession.PlatformType.AndroidPhone Or p = WebSession.PlatformType.iPhone Then
I did a test, a webapp with only a label. In the label open event I put you Select Case code and it works, for my mac it say Macintosh and for my phone it say AndroidPhone.
Note: first I changed MsgBox to Me.Text, and the label shown the correct information. Then run it as is, and it shows the correct MsgBox. Don’t have an iPhone right now, but I could test later.
But using an iPhone, this is exactly the problem, I got MAcintosh insteadof iPhone.
I use Windows7 Chrome Xojo2018.2
[quote=407423:@Michael Batakis]But using an iPhone, this is exactly the problem, I got MAcintosh insteadof iPhone.
I use Windows7 Chrome Xojo2018.2[/quote]
The problem is that the web framework currently uses user-agent parsing to figure out what the device is. If Apple has changed that string drastically (and they do from time to time) it should be that theyre no longer indicating that its an iOS device.
Ok, I just checked this on
And the user agent strings for mobile Safari have not changed enough to cause this issue.
If you go to that page on the device thats giving you trouble, scroll down to the section that says YOUR WEB BROWSER’S USER AGENT: and paste the value here.
Sorry for the late response, I was able to test on an iPhone 6 and the label/message show “iPhone”
Visited whatismybrowser and it say “Safari 11 on iOS 11.4”, part of the user agent show “…CPU iPhone OS 11_4_1 like Mac OS X…”
Maybe Michael is using different iOS version, not using the default browser with/or a changed user-agent?
I lost all yesterday’s evening try to find why… :-o
Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
just show that there is an update on Chrome… downloading
At the moment I’m interested to detect smallscreens, so if anyoneg ive me how to get user’s screen width/height i will be ableto tackle effectively.
I guess Safari will show as iPhone and Chrome will show as Macintosh, right?
Cheers , Alberto
Sorry Michael, haven’t learned that yet.
Edit: if you want to know the browser size you can use .width. This is from other thread:
Yes. If the browser doesnt tell us what the device is (or lies to us) theres not much we can do about it.
Anyway I manage to solve it:if I got Macintosh and Self.height>Self.Width then it is an iPhone!
I m thinking like that:
[quote=407943:@Michael Batakis]I m thinking like that:
You might as well use the WebSDK. Its set up to let you do communications like that.
Could you please be more specific by telling me for what “word” to look in WebSDK?
Not very familiar with…
You may find a tool I made of some use, it creates empty WCW classes with a bunch of the basics filled in: http://webgen.timi.me
Thank you again