Difference between content in uiwebview and mobile safari? - ios

I am showing a twitter feed in a uiwebview... however there is a problem: it appears significantly differently in the uiwebview then what it does in mobile safari. Ultimately, I much prefer the look of the feed as it is shown in mobile safari. Is there any way to 'trick' the web view into displaying itself as safari? Possibly by altering the user agent? Thanks.

Ended up altering the user agent. App made it past apple review fine.

UIWeView and Safari doesn't display all the pages as the same..There can be minor differences in formatting in UIWebView which won't be found in Safari..
Solution to this is to use javascript to alter the WebView itself programmatically to display things right..
more info avaialble in UIWebView Class Reference doc here

Related

Multiple tabs in UIWebView in iOS

I want to use UIWebView in my application.
I want to open up multiple URLs within the same UIWebView. Also, the tabs should be maintaining their own sessions.
Is this possible? If yes, can anyone please help me out with the same..

Support for WebView

Does video.js support Android WebView?
We use an Android app to put a tablet in Kiosk Mode in which our web app runs. However, webview video tag does not give us a image of the first frame, only the ugly widgets background.
A better question might be whether your WebView supports video.js. You need to configure the WebView to behave equivalently to a proper browser – HTML5 video definitely won't work without some tweaking. I've found this custom web view to work well (including with video.js):
https://code.google.com/p/html5webview/

Facebook like button in iPhone native application

This question seem duplicate but problem is that other question are old or not giving answer as my need.
What I have done:
I have integrated facebook for iOS 5 and iOS 6 both and it is sharing on wall properly.
Problem
My application have a UIButton "LIKE" to like my application page on facebook.
I want that if user click on this button he should be able to like that page.
I have search for hours but not able to get any proper solution.
For iOS 6 I get following link of apple iOS 6 site
iOS 6 with facebook
Here in third segment it show an image where app page is open in UIViewController with facebook like button.
and it said that we can open it without leaving our app.
I search but don't find how to open this page in UIViewController as we open dialog for share.
Ask me if you need more information.
Happy to get any kind of help or information.
As far as I know, the app shown by Apple with the Like button integrated (i.e. the App Store) is using a webview to display its content. This button is not something you get from a native code. The reason is that Facebook don't wan't to get Like actions without a user action to trigger it (I heard that from a Facebook guy at the App Day 2012 conference in Paris). And the only way to ensure that is to encapsulate and hide that in an HTML component.
What I would suggest is to instantiate a small webview displaying a page containing only the Like button of the desired page. Let us know if it work! ;-)
Mathieu is right, there is no way you can do that with a normal UIButton.
You have to use an iFrame (loaded in a UIWebView) if you want the button to like the page immediately. I did not like this approach as it takes some time for the iFrame to load.
More information can be found here: http://www.raywenderlich.com/1626/how-to-post-to-a-users-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
I ended up having a UIButton that opens the Facebook page in Facebook.app or Safari.app. The user has to press the like button manually.
It's just allowed for testing purposes and iOS only.
check this out
https://developers.facebook.com/docs/ios/like-button/

Web development for iPad: how to make safari view non-draggable

I'm making a web project that is fitted to the iPad screen. I'm trying to make it look as much like a native app as possible. It is loaded in safari or atomic browser. What I'm trying to find out is if it's possible to eliminate the drag and even the zoom functions of one of those browsers for just that site.
To rephrase, I want to make my site fixed on the screen at all times. The issue is, a user will try to hit a button and it will drag the screen.
PS. An additional question is how I can make it so images don't have the "save as" functionality if held down I tried putting a span over the images, and that worked for firefox, but not iPad safari.
If you can solve any or all of these, you would have my biggest thanks!
Turns out that there are several metatags that you can put in your js file which keep the screen fixed. Good stuff on that is here:
http://jakeboyles.com/2011/01/16/how-to-build-an-iphone-and-ipad-web-app/
As far as the "save as" issue, I don't know yet, that part of my app development hasn't been solved.

Website for iPad Mobile Safari

While creating a website for iPad Mobile Safari, I have a few questions;
Does the orientation happen automatically or do we have to write code for that ?
What is the best approach in terms of CSS/JS..I mean create separate copy of the web CSS for iPad and just update for iPad specific. Also what about JS?
What is the best way to detect for iPad (CSS/JS) and how?
Any online references which specifically covers iPad Mobile Safari development will also be great.
Thank you.
The orientation happens automatically, but you can write code to intercept the event and do things.
I highly recommend using an existing JS library such as Sencha Touch to handle the UI for you; they automatically detect the client and will display the appropriate scale of the app.
I just added a few meta tags to my current project, based on this page - http://www.nczonline.net/blog/2010/04/06/ipad-web-development-tips/
It made a huge difference. The orientation media queries work great. I madea simple example by setting the body background colour different based on orientation.

Resources