Login with Facebook in Xamarin Forms

Sign in to queue

Description

Learn how to Login to Facebook with Xamarin Forms.

This video will walk you through the process to connect Xamarin app to Facebook API:

1) Create Facebook app with Login product and get Client ID

2) Use the client Id to create a GET HTTP request for login

3) Get an access token and use it to get user profile information

Embed

Download

Download this episode

The Discussion

  • User profile image
    theSuede

    Thank You! Short and concise.
    But, please consider using a lavaliere microphone... The sound is very reverbant, voice becomes distant and hard to hear. There's lots of echo in a hard wall room.

  • User profile image
    Gautama

    MonoAndroid,Version=v6.0 missing assembly ref

  • User profile image
    Costas Aletrari

    This is a fantastic solution which suits my app. BUT once the login returns to its success page via the webview a nice red message of

    SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anynone.See the Facebook Help Center for more information.

    ive seen other peoples posts regarding this same issue,, some have the issue with ios only or andoid only. I have them both :-(

    I've added ssl to my webservice and to my restclient urls

    also my app has not yet been approved from facebook as im still in development so im not sure if being approved will solve mine and other peoples issue.

    thoughts?

  • User profile image
    Shinigami

    Hi Houssem,
    you do not how you did configure the settings of your facebook app.
    What should we configure? It is giving me a session error.
    The facebook API Version leveled to 2.8
    Your example is still using 2.4
    Can you please enlight me?
    Regards

  • User profile image
    Rob Gaudet

    Houssem, this code is not working on 6.0 and Visual Studio 2017.
    The WebViewOnNavigated is never called. Any suggestions for me?

    The async call await Navigation.PushAsync(new FacebookProfileCsPage()); seems to be the problem.

  • User profile image
    Rob Gaudet

    This is the error.

    07-11 01:26:43.535 E/mono-rt ( 2896): No native Android stacktrace (see debuggerd output).
    07-11 01:26:43.535 E/mono-rt ( 2896):
    07-11 01:26:43.535 E/mono-rt ( 2896):
    07-11 01:26:43.535 E/mono-rt ( 2896): =================================================================
    07-11 01:26:43.535 E/mono-rt ( 2896): Got a SIGSEGV while executing native code. This usually indicates
    07-11 01:26:43.535 E/mono-rt ( 2896): a fatal error in the mono runtime or one of the native libraries
    07-11 01:26:43.535 E/mono-rt ( 2896): used by your application.
    07-11 01:26:43.535 E/mono-rt ( 2896): =================================================================
    07-11 01:26:43.535 E/mono-rt ( 2896):
    07-11 01:26:43.535 F/libc ( 2896): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 2913 (Debugger agent)
    Step request failed: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
    InspectorDebugSession(20): HandleTargetEvent: TargetExited
    InspectorDebugSession(20): Disposed

  • User profile image
    MrRoboto7

    Hello I Get this error when I try to install the Nuget Package: 

    Severity Code Description Project File Line Suppression State
    Error Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

  • User profile image
    Deepak

    Hi, I am implementing your code in my project it work's great but I have face a issue i.e face book login page is doesn't appear after(2nd time login) logout of the application and again try to login in to my application via face book login.

  • User profile image
    Nuri

    Hi Houssem,

    What do you think that without "web view" solution? You know that its not nice ask e-mail for FB users. Why Xamarin forms App can not have a native login while user has been logged in FB or etc?

Add Your 2 Cents