Discussion Forums  >  WebViews and HTML for Mobile

Replies: 4    Views: 197

Joe Sprott
Code is Art
Profile
Posts: 413
Reg: Aug 20, 2011
Melbourne, FL
10,280
03/30/15 05:58 AM (5 years ago)

iOS converting all numbers to phone numbers

The following is an email that Genbook sent my client stating that this is the issue why the app is not opening Genbook calender. does anyone know how I can get iOS to stop reading numbers as phone numbers.the following is a response to my client from genbook. So if these guys are correct can someone lead me to a solution

"I've found this app: <a href="https://itunes.apple.com/us/app/caduceus-medical-group/id514081297?ls=1&mt=8" target="_blank" rel="nofollow">https://itunes.apple.com/us/app/caduceus-medical-group/id514081297?ls=1&mt=8</a> so I do indeed think it's happening when your custom app embeds our website.

Anyway, what is happening is that the UIWebView (the component that can show web pages in iOS) tries to be very smart and turns numbers into phone numbers and times into clickable things that would open the calendar app. This is not something that Genbook does but something that happens when the UIWebView is not configured correctly. Since the headers are removed, I assume the developer is changing some of the HTML before it's displayed so he may have to solve this issue in his altered HTML too."
 
Joe Sprott
Code is Art
Profile
Posts: 413
Reg: Aug 20, 2011
Melbourne, FL
10,280
like
03/30/15 06:24 AM (5 years ago)
please have a look at this stack string and can anyone tell me where a box is located in xcode. I am looking at BT-viewController.m and David speaks to some phone number craziness with parenthasis but I need iOS to stop reading all numbers as phone number. at least I hope I have a direction here.

http://stackoverflow.com/questions/768337/why-does-uiwebview-keep-detecting-phone-numbers

is this check box available with BT core I don't see it
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/30/15 06:24 AM (5 years ago)
In your webview configuration, try adding this:

webView.dataDetectorTypes = UIDataDetectorTypeNone

a bit of it here: https://developer.apple.com/library/ios/qa/qa1495/_index.html

Cheers!

-- Smug

This code would be in the implementation (m) file of the plugin in question...

Remember if you do this, 'no' data will be detected, including links.
 
Joe Sprott
Code is Art
Profile
Posts: 413
Reg: Aug 20, 2011
Melbourne, FL
10,280
like
03/30/15 06:27 AM (5 years ago)
thanks I will try and let know
 
Joe Sprott
Code is Art
Profile
Posts: 413
Reg: Aug 20, 2011
Melbourne, FL
10,280
like
03/30/15 11:41 AM (5 years ago)
you were correct smug. I found the document behavior on these screens David provided and made the changes. I assumed it would not work because the tapping is a link which is selected with url.

Any way long story short it works fine now that I selected the proper behavior in control.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.