Native Facebook Login


#1

Hello everyone,

My Ionic app currently uses Firebase Social Authentication to log users into the app. The authentication is displayed in the Inapp browser. However, I want to use the native Facebook app on the user’s device to authenticate them (if they have the app) and to fallback to the browser version if they do not. I know of the ngCordova Facebook plugin but the documentation is not really good.
Does anyone know good resources that would teach me how to properly use this plugin? Or is there an alternative plugin?
Thank you everyone.


#2

Hello,
I’m interested in this too, since I now use the oAuth ngCordova plugin, and I found out that you can’t access friends list of the current user with the graph API :frowning:
The tricky part is to check whether Facebook native is installed or not.


#3

Hey! I have created a starter template for the sole purpose of integrating Native Facebook and Native Google login. Check it out on github. It has complete instructions on how to set up Google and Facebook auth.


#4

Awesome @siddhartha , can’t wait to try it to replace my Facebook web login setup.
Will tell you how it went !


#5

Hello siddhartha

thanks for posting this, but i am struggling to implement this. Despite that i checked the demo apk and the facebook login is painfully slow.


#6

hey sorry for the late reply. Did you have any success with this?


#7

Could anyone post how to integrate these logins from ionic-starter-oauth to my own application?


#8

Sure no problem. Can you share the code?


#9

Hello @srameshr,
I am trying to follow your steps but i get this error at installation of plugins

cordova -d plugin add /Users/Desktop/Ionic 2 Demo/phonegap-facebook-plugin --variable APP_ID=“App_id” --variable APP_NAME=“App_name”

Executing “before_plugin_add” hook for all plugins.
No version specified, retrieving version from config.xml
No version given in config.xml, attempting to use plugin engine info
Error: Registry returned 404 for GET on https://registry.npmjs.org/ionic-oauth
at makeError (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
at CachingRegistryClient. (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/npm-registry-client/lib/request.js:242:14)
at Request._callback (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
at Request.self.callback (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/request/request.js:199:22)
at emitTwo (events.js:100:13)
at Request.emit (events.js:185:7)
at Request. (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/request/request.js:1036:10)
at emitOne (events.js:95:20)
at Request.emit (events.js:182:7)
at IncomingMessage. (/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/request/request.js:963:12)

please help me.
Thank You !!


#10

Yep you right Kanun when I run the Facebook login demo on my LG G4 device it is very very slow but when I execute it on the browser its not slow, did you resolve this issue?