A child browser plugin with url change callback. Meant to use with social networks.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
blackberry.polarmobile.childbrowser
childbrowser
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