[英]Ionic framework facebook login integration
I am playing with Ionic framework and wondering if it's possible to implement the following with Ionic: 我正在使用Ionic框架,想知道是否有可能用Ionic实现以下内容:
Perform a login with Facebook by opening the native Facebook application on both iOS/Android (not the in-app browser thing) and ask for permission for my app then if the user approves it I want his accessToken to be sent to my application. 通过在两个iOS / Android上打开本机Facebook应用程序(而不是应用程序内浏览器)来执行Facebook登录,然后请求我的应用程序许可,然后如果用户批准,我希望将他的accessToken发送到我的应用程序。 Is that doable ? 那可行吗?
I have gone through a lot of documentation and as far as I can see the only way to achieve that is to use in-app browser where the user approves the permission. 我已经阅读了很多文档,据我所知,实现此目标的唯一方法是使用用户批准权限的应用内浏览器。
use the $cordovaFacebook
module; 使用$cordovaFacebook
模块; a successful login returns the accessToken. 成功登录将返回accessToken。
here is an example using the accessToken
to login to Parse.com 这是使用accessToken
登录Parse.com的示例
http://www.clearlyinnovative.com/ionic-framework-facebook-login-with-parse http://www.clearlyinnovative.com/ionic-framework-facebook-login-with-parse
$cordovaFacebook.login(["public_profile", "email", "user_friends"])
.then(function(success) {
// { id: "634565435",
// lastName: "bob"
// ...
// }
}, function (error) {
// error
});
http://ngcordova.com/docs/plugins/facebook/ http://ngcordova.com/docs/plugins/facebook/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.