我在我的当前angular应用程序中使用Almog Baku的ngFacebook。在测试环境中,它可以正常工作。但是在通过phonegap构建的apk中,它无法正常工作。我已经包含了
和
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
我已经将代码添加到我的config.xml
文件中,但仍然无法弹出InAppBrowser或新标签页。
我的App.js
文件如下:
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');
});
在我的控制器中:
$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();