Create an account using Facebook API

New Member
1 0 0

Hello,

I am a fresher in shopify development platform.
I have created a login link which would take user to get Facebook login information through below code, its working fine and fetching the data.

   window.fbAsyncInit = function() {
    FB.init({
      appId      : '2435XXXXXXXXX',
      xfbml      : true,
      version    : 'v2.7'
    });
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

  
  function fb_login(){
    FB.login(function(response){
      if(response.status === 'connected'){
        alert('connected');
      }
      else if(response.status === 'not-authorized'){
        alert('not logged in');
      }
      else{
        alert('not logged into facebook');
      }
    
   
    FB.api('/me', 'GET',{fields:'first_name,last_name,id,email,birthday,gender'},function(response){
     
       });
     
    });
  }

  I want to submit the account creation form with the details I got from Facebook API directly from the code and login the user with this information.
  Could anyone please help me on achieving this.
 
Thanks in advance.
 

0 Likes
New Member
1 0 0

Same ^^^

0 Likes