I have an MVC 4 project that has a view that switches between Desktop or Mobile.
This is the view when you are on the Desktop website...
Mobile View
This is the view when you are on the Mobile website...
Desktop View
This is the action is calls...
Public Function SwitchView(Mobile As Boolean, ReturnUrl As String) As RedirectResult
If Request.Browser.IsMobileDevice = Mobile Then
HttpContext.ClearOverriddenBrowser()
Else
HttpContext.SetOverriddenBrowser(If(Mobile, BrowserOverride.Mobile, BrowserOverride.Desktop))
End If
Return Redirect(ReturnUrl)
End Function
On an iPhone 5, with iOS 6 it works perfect. I can switch from Mobile view to Desktop view and then back to Mobile view again.
On an iPhone 3, with iOS 4.1 it does not work. It initially correcting shows the Mobile view, I can switch to the Desktop view correctly, but I cannot switch back to the Mobile view.
I've tried replacing the action with...
Public Function SwitchView(Mobile As Boolean, ReturnUrl As String) As RedirectResult
HttpContext.SetOverriddenBrowser(BrowserOverride.Mobile)
Return Redirect(ReturnUrl)
End Function
This makes no difference. My user agent string is as follows...
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-gb) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7
If I force my user agent string to be this in IE 10, it works perfectly fine, so I assume it is some sort of iPhone issue opposed to the detection of the user agent.
Anyone know why switching back to the Mobile view does not work?
30 minutes after posting I realise the issue. Would you believe it wasn't working simply because I didn't have the date set correctly on my iPhone!
Related
I'm working on a website with angular-material. Everything works well except with mobile view on IOS.
Iphone: 5c or 6
IOS version: 8.1 or 9
Here's a screen shot, on the left part the good rendering on Android, on the right, the IOS one.
The only difference beteween IOS & Android is the store button shown (Play for android, AppStore for IOS) but I tried to remove them already. The code can be inspected directly on http://www.luditeam.com
Did I miss something? Is it a known problem?
Thanks in advance.
I know that for Android it's possible to use Chrome://inspect to view the phone screen on your desktop. Clicking there is equal to tapping on the phone.
It's fine for browsers and after 4.4 - for apps that have some special lines of code inserted.
Whether it's possible for iPhone / iPad?
i.e. I have a REAL device with latest OS installed, which screen I'd like to be shown on MAC + clicking on the items on the screen will be equal to tappping on the phone.
XCode iOS Simulator - I am somewhat surprised you missed this part of the IDE.
It seems that this is not possible.
As I'm not using the affilate stuff, I implemented the Smart App Banner on my website like this:
<meta name="apple-itunes-app" content="app-id=...">
On my iPad Mini (iOS 7.0.2) it's showing up without any problem, on my iPhone 5 (same version) it's not showing up.
Both got the app installed already (the banner should show "Open").
Do you know what could be wrong?
Thank you!
Just a heads up, these banners only show on safari, no other ios browsers .
I am testing a web app by running selenium test scripts on an iPad simulator using Selenium iPhone driver. The app opens in UIWebView inside the simulator. However the top part of the app (title , toolbar etc.) gets hidden from view. I am able to see the top part when I drag down and hold the bottom part of the app.
1) How can I make UIWebView make the app visible fully? I guess it is because of the difference in iPad simulator version used in the iPhone driver source code and one that I am using to launch the app(iOS 6.0). However I have no idea how to proceed with this as but I'm not familiar enough with iOS development.
2) Is testing in UIWebview same as testing the app in mobile Safari? Is there any way I can test the app in mobile Safari in an iPad using Selenium?
as I understand, you want to test the website, not the iphone app.
Then you could just as easily open it in mobile safari and use bookmark to view full screen (if you wanted the app to go fullscreen, you would need to do it programmatically)
I updated the Ipad storyboard file located at src\resource. The webView setting Y coordinate was set to -84 and I changed it to 0. This might help
How can I get to know that the device is iphone or ipad using actionscript3.0?
Check out the Capabilities class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html
There's no 100% method to test if something is a specific device (Adobe say to not do it), mainly because you can end up with a ball of spaghetti code that's not future proof (e.g. the resolution/dpi roughly doubled between the iPhone 3GS and the iPhone 4, and who can say what the iPhone 5/6 etc will have).
What you could use are cpuArchitecture, manufacturer, os, pixelAspectRatio, screenDPI, screenResolutionX, screenResolutionY and touchscreenType to help try and figure it out.
There's also ContextMenu.isSupported as the context menu (what shows when you right-click on a swf) doesn't show up on smart phones or tablets (no right-click)