Skip to the content

Xamarin Blog by officialdoniald

Learn everything about Xamarin

  • My books
  • My NuGet packages
  • CV
  • Posts
Xamarin
2020.09.01.

Facebook authentication and get information about the user with Plugin.Facebook

By bence960206
  1. When we have a Xamarin.Forms Portable application we have to click on References -> Manage NuGet Packages.
  2. Type in: Plugin.Facebook and Install.
  3. After the Install it creates 4 folders: Models, View, ViewModel és Services.
  4. If it is possible, leaves the ViewModel folder intact.

Models folder: It contains the response Object Model(User’s information)

Services:

var requestUrl =

“https://graph.facebook.com/v2.7/me/?fields=name,picture,work,website,religion,location,locale,link,cover,age_range,bio,birthday,devices,email,first_name,last_name,gender,hometown,is_verified,languages&access_token=”

+ accessToken;

It is necessary to define the query URL, which ask for details from Facebook down. After the me/? and for the &access_token we can define, which information do we need about the user.

View: FacebookProfileCsPage.cs is a Page, which display the data.

What must we do before we are using this package?

https://developers.facebook.com/apps/ we have to register our application like web application.

If we are ready, we have to add to our Product a Facebook Login and we have to write theese URLs to the Valid OAuth Redirect URLs.

https://www.facebook.com/connect/login_success.html

and http://www.facebook.com/connect/login_success.html just in case.

private string ClientId = “165942640479284”; We have to override this string of ours application AppID.

Link about this NuGet package: https://channel9.msdn.com/Blogs/MVP-Windows-Dev/Login-with-Facebook-in-Xamarin-Forms

Tagsfacebook login

Post navigation

Previous PostPrevious Google authentication and get information about the user with Plugin.Google
Next PostNext Xamarin.Forms Binding in C#

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Xamarin developer jobs

https://jooble.org/jobs-xamarin-developer

Recent Posts

  • Xamarin.Forms save and read objects
  • Xamarin.MQTT
  • Xamarin.Forms.SaveOpenPDFPackage
  • Xamarin.Forms.DynamicSize
  • Xamarin.Forms.MVVM

Recent Comments

    Archives

    • February 2021
    • December 2020
    • November 2020
    • September 2020

    Categories

    • Xamarin

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Proudly powered by WordPress | Theme: Popularis Writer