Facebook is one of the most popular social networks and is widely used for login to different applications. You can easily login via Facebook using OAuth, but you will stuck if you build a hybrid app, so you need another solution for that. Using Phonegap-Facebook-Plugin you can implement login in a dozen of minutes.
// you can get user data here or redirect to main page depending on your goals
// here you can call login or redirect to login page
// any actions to handle exceptions
What next? If we are not logged in we need to call login() function.
The function takes an array of data fields you want to have access to. Also it gets two callback functions - one for successful login, other - to handle an exception. In success function you can do whatever you want i.e. you can get data about user: