How to implement Log in with Facebook and Google + in an Ionic App


#1

I am developing an application using ionic which needs a functionality of login via Facebook and Google +.
But unfortunately ngCordova does not provide any plugin to implement Facebook and Google + login via the native app. Can anyone help me achieving that.?


#2


No idea about Google+


#3

How to implement it with ionic. ng-cordova conatins some code for this. But i really donot know how to get it done. Do you have any idea?


#4

ngCordova only have the social sharing plugin, do you want to Login or just share?


#5

I want to log in using the fb app. If you dive into the ng-cordova.js you can find facebookConnectPlugin with the provider $cordovaFacebookConnectProvider. But I really cant understand how to use them. Can you please have a look at the ng-cordova.js? Please… Please…


#6

OMG ng-Cordova have updated the DOCS in their website. … Let me try this…


#7

I’m trying to login with google + this way :


#8

Hi @ssswagatss,

I recently added Oauth support to the ngCordova plugin. You can find documentation on it here:

http://ngcordova.com/docs/#Oauth

After registering your application with Google and Facebook you can include your application key in your app. Oauth will initiate a browser login flow and have the user sign in using those services.

Let me know if you plan to go this route and have further questions.

Regards,


#9

But the plugin did not work for me. Can you please describe in detail how it went for you?


#10

Hello @siddhartha,

Finally the plugin didn’t work for me too :confused:


#11

What errors are you stuck up with?
Can you please let me know.

I get “Error: User Cancelled” error, when I try to login with Google+


#12

I deleted code for google+ connect and turn the project without this feature. I don’t remember the error, sorry …


#13

Can you try this: https://github.com/cabotdeveloper/CordovaPlugin-GooglePlusLogin

and please let me know how does this go


#15

The problew with your plugin is that the user will have every time to fill in username and password (of the social account). This cancels the advantage of using social login


#16

Not true. If you store the access token, you won’t need to login every time.


#17

Thanks for your reply. I’ll do some more tests.


#18

Hi, these posts will guide you on how to add Facebook and Google+ Native Logins to your Ionic apps:


#19

With ngCordova-OAuth, If you store the access_token, users still have to type password every hour. Unless it’s a banking app, I think its really annoying for the user.


#20

Its about to be deprecate you might see warning while logging in for Google.


#21

hi @ssswagatss

here i mention steps for google login and google app setup (google developer console account)

**Ionic 1 + google login + Android **
Ionic 1 + google login + IOS

You can find documentation and demo code on it here