Page 1 of 1

Displaying web content from URL in app?

Posted: Thu Nov 18, 2010 12:59 am
by ctflatt
I want to create a "web view" within an app. I've read the "Non-File URL Access" section in the iOS handbook, but honestly I don't know where to begin.

First, is this possible?

Second, if it is (which I'm assuming), what does one do with the following example from the handbook:

put url (“http://www.google.com”) into tGooglePage

?

Can someone point me in the right direction?

Many thanks...

Re: Displaying web content from URL in app?

Posted: Thu Nov 18, 2010 3:03 am
by Mark
Dear ctflatt ,

Code: Select all

put url (“http://www.google.com”) into tGooglePage
puts the data from that url into variable tGooglePage. You can set the htmlText of a field to (the content of) that variable. This will not result into a useable web view, it will just display the text of the website in a humanly readable format.

The only way to get a "web view" is currently to open the URL in Safari. This should probably be

Code: Select all

launch URL "http://www.google.com"
(I haven't tested this on iOS).

Best regards,

Mark

Re: Displaying web content from URL in app?

Posted: Thu Nov 18, 2010 11:09 am
by ctflatt
Mark:

Thanks for the information. Now I understand.

Since the iOS does not support libURL, do you know if there is a way to launch the URL per your reply, and then from Mobile Safari, relaunch the app that requested it?

Here's the scenario:

User launches revMobile app from the start screen.
Within the app, a URL is requested which closes the app and launches Mobile Safari.
Once the Mobile Safari pages have fulfilled their need, can you link back to reopen the original revMobile app?

Since an integrated web view is not yet supported, this would work for me if it is possible.

Thanks, again, for your previous post!

Re: Displaying web content from URL in app?

Posted: Thu Nov 18, 2010 11:49 am
by Mark
Dear Dear ctflatt ,,

You need to add the following to the plist (replace myapp with the name of your app):

Code: Select all

CFBundleURLTypes
 
    CFBundleURLSchemes
 
      myapp
 
    CFBundleURLName
    com.yourcompany.myapp
Right now I'm not entirely sure where in the plist to add this, but if you look at the plist, you might find the CFBundleURLTypes somewhere. You should be able to find the plist in your standalone for iPhone. You should now be able to (re)launch your app with a link to myapp:// in a website.

Kind regards,

Mark

Re: Displaying web content from URL in app?

Posted: Fri Nov 19, 2010 3:20 am
by ctflatt
Mark:

Thanks SO MUCH for this. Can't wait to put it to the test.

I'll post my experience here at some point this weekend...

Thanks again for taking the time to write out such clear information.