How do you remove links from UIWebView? - objective-c

I'm using UIWebView on my iPhone application. How do I remove the links that ios put by it self. For example I have some double value and ios think it's a phone number and highlighting it!
I try to disable the user interaction from the xib file. Didn't help. Can someone help me.

In the <head> of the html, you can put:
<meta name="format-detection" content="telephone=no">
Safari HTML Reference:
By default, Safari on iOS detects any string formatted like a phone
number and makes it a link that calls the number. Specifying
telephone=no disables this feature.
Or to unset this detection from a web view programatically using the dataDetectorTypes mask:
webView.dataDetectorTypes &= ~UIDataDetectorTypePhoneNumber;

Have you tried to change the dataDetectorTypes value ?
You can use this property to specify the types of data (phone numbers, http links, email address, and so on) that should be automatically converted to clickable URLs in the web view. When clicked, the web view opens the application responsible for handling the URL type and passes it the URL.
See more details here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebView/dataDetectorTypes

Related

Can I remove the title/border of an app in Rally?

I recently found that one of the custom apps I can add to my Rally homepage is a custom HTML app.
This will be really useful to me, since I can use some HTML (Bootstrap) headers to separate apps on my page and make it more organized.
I got the custom HTML to show properly (and I currently have a header/divider) however, it is showing the grey title bar just like any other app would.
Is it possible to hide this when using the HTML app, so just the HTML output shows?
(If anyone is familiar with apps in Sharepoint, it's called a "Chrome" and you can hide the chrome/title so just the content shows.
I don't think there's any built-in chrome to the apps themselves... Can you show a screenshot? Are you following the general formula to embedding apps presented in this guide?
https://help.rallydev.com/apps/2.1/doc/#!/guide/embedding_apps

display html in xaml

I wasted few hours for looking the answer and I'm very sad cause I didn't find anything usefull. I have a CMS in cloud and it provides content for diffrent devices like www site and my new windows store application.
I want to use html formating. I've already created app in c# and xaml and I'm wondering how can I display html
I was happy cause I found http://nuget.org/packages/RichTextBlock.Html2Xaml but I can't make it work. I get blank page. No text, no error, no nothing.
Can someone pls tell me how can I display html in my app ?
Use a WebView/WebViewBrush or use HTML Agility Pack and implement the styles/rendering yourself.
In WinRt app you can display html code by some ways:
Using WebView with it's NavigateToString("html content")
Using WebViewBrush and displaying it in rectangle
If you had your .html file local - you can open it with myWebview.Navigate(new Uri("ms-appx-web:///" + myPath));
You can make a screenshot of webpage by the method wich I describe here and open it as a picture.
For more info, see the WebView control sample

Whats purpose of RSS feeds link in header?

Most of the news/blogs websites include RSS feeds link in their header. For example:
<link rel="alternate" type="application/rss+xml" title="Example Feed" href="http://example.com/feed/" />
I want to know what is the practical use of adding above? Is it to tell the browser that the website has RSS feeds? In past Firefox has the button in the address bar, but now they have remove it. Also if some user want to subscribe the RSS, he needs to enter the feeds url directly. So where it is being used? Thanks
Yes, it is to tell anything consuming the page (e.g. a browser) that there is an alternative form of the content elsewhere.
Most browsers used to all have an RSS button that would light up if it saw this, to allow you to subscribe to the feed.
RSS has (arguably) dropped in popularity, so this is less common today by default in browsers. But extensions and so on will still use it.
Or indeed, if you add a "normal" url to something like Google Reader, it will fetch that page, and look for an rss link in the head tag, to find the final feed url.

Bring Safari to front

I'd like to bring Safari to the front (switch to) but without using a URL, instead I'd like to see the "pages" view so the user can pick an already loaded page. Is this possible?
We open links in Safari and if the user returns to the app and selects the link again, I'd rather let them pick which Safari page to browse instead of opening a new one. I know that if the same URL is called it will open the correct page but the user may have navigated within the original site so the url no longer matches.
Thanks,
Rick
I don't think that its possible, i would use a UIWebView inside your app in order to get that experience you want, you can find the UIWebView apple docs here (http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html) and also the equivalence of c# methods here (http://tirania.org/tmp/rosetta.html) hope this helps
Alex
Your app doesn’t get control of Safari’s UI. You might, however, be able to design your site so that it handles navigation via Javascript—AJAX and whatnot—so that the actual page URL doesn't change, and thus so that the page, re-opened from your app, brings up the existing Safari page. Of course that introduces further problems with your pages no longer being bookmarkable, but you might find that an acceptable tradeoff.

iPhone Web Application

I had a quick question regarding UIWebView. Is there anyway to programmatically navigate the UIWebView? Essentially, I prompt the user for certain information, such as (Current Location, Time). Using this information, I would like to fill out and complete a form on a webpage, and display the resulting UIWebView to the user. Is this possible?
You could use JavaScript to control the UIWebView using the stringByEvaluatingJavaScriptFromString method. For example you should be able to insert text into an input and submit a form:
NSString* script = #"document.getElementById('Name').value = 'Hello'; document.getElementsByTagName('form')[0].submit();";
[self.web stringByEvaluatingJavaScriptFromString:script];
You'd have to customize the JavaScript to do whatever you want. For example, you could inject values that you had collected into the script, then run the JavaScript.
You could hide the UIWebView until the new page had loaded, then show it to the user.
Come to think of it, it'd be nice if there were a Selenium type wrapper around the web view, but I don't know of anything like that right now.