QMLFB icon indicating copy to clipboard operation
QMLFB copied to clipboard

Tiny example how to authenticate people via FB in QML

THIS PROJECT IS NO LONGER MAINTAINED OR UPDATED! THERE MIGHT BE SOME FORKS AROUND THAT ARE MORE UP TO DATE. OR MIGHT NOT.

/* * *

  • QMLFB version 0.1b by Jesse Ikonen
  • =======================================*
  • Simple QML Component that authenticates your users using Facebook Graph.

*/

Usage:

  • Use like any file component. Facebook application id property is required:

    Facebook { id: facebook property string facebook_display_style: "touch" // or "wap" property string facebook_application_id: "<YOUR FB APP ID HERE>"

      function whenUserIsAuthenticated(userid, usertoken){
          // access graph to get my name
          my_graph(function(){main.name = this["name"]});
      }
    

    }

  • Some properties you can hook into:

    facebook.user_is_authenticated => returns if user is authenticated or not (bool) facebook.user_facebook_id => returns user fb id facebook.user_facebook_token => returns user fb token facebook.my_pic_url => returns your picture url (string) facebook.me => returns your fb graph data (variant) so you can do things like, text: facebook.me.name

  • Access functions to graph are not done yet, but you can use getJSON helper from helpers.js if you really need something else.

Thank you.