我目前使用的离子框架和ngCordova的移动应用程序。我使用ngCordova的Oauth $cordovaOauth http://ngcordova.com/docs/#Oauth登录facebook。
这是以下代码
$scope.facebookLogin = function() {
$cordovaOauth.facebook("CLIENT_ID_HERE", ["email"]).then(function(result) {
// results
}, function(error) {
// error
});
}我的问题是,如果用户决定不分享他的电子邮件,我需要再次问他,取消访问权。我该怎么做?
发布于 2014-12-12 16:41:30
根据Facebook文档,您需要将auth_type=rerequest添加到Oauth调用中。
请参阅此处的文档:
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.2
目前,ngCordova只在其最基本的级别上支持Facebook登录,因此需要对库源进行编辑以支持此更改:
https://github.com/nraboy/ng-cordova-oauth/blob/master/ng-cordova-oauth.js#L198
如果你自己不想要这个功能,我建议你加一张票:
https://github.com/nraboy/ng-cordova-oauth/issues
致以敬意,
https://stackoverflow.com/questions/27447080
复制相似问题