Preview the Cordova 2.3.0 iOS inAppBrowser now!


This feature, built into Cordova 2.3.0, will take the place of ChildBrowser for me. Here are the steps to take to preview it yourself.

1. Download the zip file from https://github.com/apache/cordova-ios

2. Zip file opens as: cordova-ios-master

3. In Terminal, type cd and a space and drag the cordova-ios-master directory’s bin/ directory to the Terminal.

4. Hit Return.

5. Add your version of the following groups of information and hit Return (replace with your own path; there shouldn’t be spaces in your directory names):

./create /Users/Steve/Documents/PhoneGap_apps/PhoneGap_apps/inAppBrowserTest com.companyname.inAppBrowserTest inAppBrowserTest

6. In index.html after the <body> tag, add and save file:

<div style=”padding:1em 2em;”>
<a href=”#” onclick=”window.open(‘http://iphonedevlog.wordpress.com&#8217;, ‘_blank’, ‘location=no’);”>without location bar</a>
<br><br>
<a href=”#” onclick=”window.open(‘http://iphonedevlog.wordpress.com&#8217;, ‘_blank’);”>with location bar</a>
<br><br>
<a href=”#” onclick=”window.open(‘http://iphonedevlog.wordpress.com&#8217;);”>shown in web view ‘)</a>
<br><br>
<a href=”#” onclick=”window.open(‘http://www.youtube.com/watch?v=gEcCGN7diwU&#8217;, ‘_system’);”>system browser</a>

</div>

7. Open in Xcode and click on Run to test!

Use _blank to show non-whitelisted URLs in inAppBrowser.
Use location=no to refrain from showing the location bar. It is shown by default, so you can leave off location=no or location=yes and the path URL will be shown above the Done button at bottom.

More in the wiki at http://wiki.apache.org/cordova/InAppBrowser 

Other setup instructions: https://github.com/apache/cordova-ios/blob/master/FirstRun.md

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s