简体   繁体   中英

Ionic framework facebook login integration

I am playing with Ionic framework and wondering if it's possible to implement the following with 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. 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; a successful login returns the accessToken.

here is an example using the accessToken to login to Parse.com

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM