login with Fb and Google using Ionic

1k views Asked by At

I am trying to integrate fb login and google login with ionic framework .

Any idea which plugin suits best . I had tried InappBrwoser Plugin , giving me error "Could not find InAppBrowser Plugin". but i am not successful on the same.

Any help on this ?

Thanks

4

There are 4 answers

0
aorfevre On

I personnaly use Hello.js that is a great JS librairy.

0
bajran On

NPM provides the package called angular4-social-login

Social login and authentication module for Angular 4 / 5. Supports authentication with Google and Facebook. Can be extended to other providers also.

Package for social media login

3
Mark Veenstra On

Any idea whch plugin suits best

Yes, this plugin.

module.controller('MyCtrl', function($scope, $cordovaOauth) {
    $scope.facebookLogin = function() {
    $cordovaOauth.facebook("CLIENT_ID_HERE", ["email"]).then(function(result) {
        // results
    }, function(error) {
        // error
    });
    }

    // $cordovaOauth.dropbox(string appKey);
    // $cordovaOauth.digitalOcean(string clientId, string clientSecret);
    // $cordovaOauth.google(string clientId, array appScope);
    // $cordovaOauth.github(string clientId, string clientSecret, array appScope);
    // $cordovaOauth.linkedin(string clientId, string clientSecret, array appScope, string state);
    // $cordovaOauth.instagram(string clientId, array appScope);
    // $cordovaOauth.box(string clientId, string clientSecret, string state);
    // $cordovaOauth.reddit(string clientId, string clientSecret, array appScope);
    // $cordovaOauth.twitter(string consumerKey, string consumerSecretKey);
    // $cordovaOauth.meetup(string consumerKey);
    // $cordovaOauth.foursquare(string clientId);
    // $cordovaOauth.salesforce(string loginUrl, string clientId);
    // $cordovaOauth.strava(string clientId, string clientSecret, array appScope);
});
0
diegofcornejo On

If you are using ng-cordova just update the library and remove the plugin inappbrowser from your project and add the plugin this way "cordova plugin add cordova-plugin-inappbrowser", the old library try to find "org.apache.cordova.inappbrowser" but the correct name for this plugin is "cordova-plugin-inappbrowser".