Displaying web content from URL in app?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Displaying web content from URL in app?

Post by ctflatt » Thu Nov 18, 2010 12:59 am

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...

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Displaying web content from URL in app?

Post by Mark » Thu Nov 18, 2010 3:03 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Displaying web content from URL in app?

Post by ctflatt » Thu Nov 18, 2010 11:09 am

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!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Displaying web content from URL in app?

Post by Mark » Thu Nov 18, 2010 11:49 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Displaying web content from URL in app?

Post by ctflatt » Fri Nov 19, 2010 3:20 am

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.

Post Reply

Return to “iOS Deployment”