Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A child browser plugin with url change callback. Meant to use with social networks.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 blackberry.polarmobile.childbrowser
Octocat-spinner-32 childbrowser added ChildBrowser and FileUpload for Playbook April 23, 2012
Octocat-spinner-32 README
README
//Example logging to EventLog and System.out
console.log = function(msg) { motek.childbrowser.log(msg); };
console.log("Hello!");

//Exmaple of opening a browser and listening for location changes:
function getFacebookToken(sourceScreenCode) {
	try {
		//live
		var appID = "123456789";
		var redirect = "http://www.facebook.com/connect/login_success.html";

		var path = 'https://www.facebook.com/dialog/oauth?display=wap&scope=publish_stream,offline_access,email&';
		var queryParams = ['client_id=' + appID, 'redirect_uri=' + redirect + "?n=" + sourceScreenCode, 'response_type=token'];
		var query = queryParams.join('&');
		var url = path + query;
		motek.childbrowser.open(url, urlCallback);
	}
	catch(e) {
		alert(e);
	}
}

function urlCallback(newUrl)
{
	console.log("urlCallback: " + newUrl);
	//extract token from url
}

//Example FilePicker
webworks.ui.filePicker.open(callBackFnFilePassedIn);

There is also a similiar child browser and File Upload plugin for Playbook in this subfolder:
blackberry.polarmobile.childbrowser


Something went wrong with that request. Please try again.