window.plugins is undefined error
Hi I try to test the facebook api example however when pressing the button - where I have attached the code below in the click event - I get an error in firefox console where I test it that window.plugins is undefined is there some way I can include it so that it works ??? (In the App settings the phonegap is set.)
var redirectUrl = 'this is the redirect url';
var url = 'Here goes the facebook details url';
var cb = null;
if(window.plugins) {
cb = window.plugins.childBrowser;
alert("window plugin");
}
if (cb != null) {
/* Wen native childBrowser plugin must be used to navigate to facebook. /
cb.onLocationChange = function (url) {
if(url.indexOf(redirectUrl) === 0) {
/ if user successfully logged in /
cb.close();
var vars = parseUrlVars(url);
localStorage.setItem('code', vars.code); / store secret code /
Appery.navigateTo('result', {reverse: false}); / Navigate to page 'result' */
console.log("Code taken");
console.log(localStorage.getItem('code'));
}
};
Code: Select all
cb.showWebPage(url); } ;