Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Here's how to load web content in a Gideros app (iOS / Mac) — Gideros Forum

Here's how to load web content in a Gideros app (iOS / Mac)

Tom2012Tom2012 Guru
edited October 2012 in General questions
Took me a while to figure out how to do this and despite searching, couldn't find any info on it. So here's an easy guide for anyone wanting to load a webpage in their app. The app won't have a URL bar and won't redirect to safari.

1) Download UIKIt https://github.com/carolight/MHUIKit

2) In your app, use this code:
Scene2 = gideros.class(Sprite)
 
function Scene2:init()
 
require "ui"
 
local webview = WebView.new('<a href="http://www.webaddresshere.com'" rel="nofollow">http://www.webaddresshere.com'</a>)
 
webview:setRotation(0) -- corrects orientation
 
webview:setPosition(0,0)
webview:setSize(1024,768);
 
addToRootView(webview);
 
end
3) Export your app in Gideros to applications/Gideros (your gideros application folder)

4) Look for uikit.mm in the download from step 1

5) Put it into the app folder that you just exported, in plugins

6) Start Xcode and open your project exported in step 3)

7) Expand the folders in Xcode and go down to YouApplicationName/Plugins

8) Right click and choose Add Files To...

9) Choose the uikit.mm file

10) Build and run the app and the web content should load in your app.

Notes: You'll need to set autorotation on in the app settings in Gideros (right-click on project)

Comments

Sign In or Register to comment.