Im using ngFacebook by Almog Baku in my current angular app. In test environment it is working fine. But in apk build via phonegap it isn't working. I have included
<dependency id="cordova-plugin-inappbrowser" />
and
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
into my config.xml
too but still no InAppBrowser or new tab poping up.
My App.js
is
var myApp = angular.module('myApp', [
'ngTouch',
'ngRoute',
'myApp.controllers',
'ngIdle',
'ngFileUpload',
'ng.deviceDetector',
'oitozero.ngSweetAlert',
'angular-hmac-sha512',
'ngFacebook'
]);
myApp.config( function( $facebookProvider ) {
$facebookProvider.setAppId('1869339203095182');
});
And in my controller:
$scope.login = function() {
$facebook.login().then(function() {
refresh();
});
}
$rootScope.$on('event:social-sign-in-success', function(event, userDetails){
console.log(userDetails);
})
function refresh() {
$facebook.api("/me",{fields: 'id,name,email'}).then(
function(response)
{
//console.log( response );
},
function(err) {
console.log(err);
//$scope.welcomeMsg = "Please log in";
}
);
}
refresh();