×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    Lightbulb QML Facebook authentication

    Hello,

    I've released a little component that might help you all to use FB authentication in your application.

    You can find it https://github.com/yoka/QMLFB


    Here's the readme to give you all some idea what it does:

    Code:
    /*
    *
    *
    *   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.

    If you like this, let me know. Feel free to fork me @ github if you got some cool ideas or something.. And of course if you're from Nokia you could send me some new Nokia phones so I can run native.

    Have fun!

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: QML Facebook authentication

    Hi,

    Thanks for the code. Can you put all the code into one zip. I was trying to build the code and getting error like "main.qml:43: Unable to assign [undefined] to QString text" and I was just getting one text on the screen with some animation.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    Re: QML Facebook authentication

    Hi,

    I find zipping it a bit overkill because you can easily clone it using git.

    edit: actually you can download zip from github. Just click "Downloads" button.

    Did you give it Facebook Application Id like instructions say?

    Facebook requires application id because it uses it to generate access token which
    is used to fetch data from graph API. Token is then linked to that application and the
    permissions user has given to it. I'm planning on adding support for different permission
    requests later. Then one could easily request email address etc. from FB.

    main.qml is example application, but you still need to replace <YOUR FACEBOOK APP ID> text
    with your facebook application id to make it work. If ID is not set, then WebView won't load FB
    stuff at all.

    Let me know if you have any problems.
    Last edited by yokascript; 2011-02-01 at 06:04.

  4. #4
    Nokia Developer Champion
    Join Date
    Aug 2008
    Location
    Vadodara, India.
    Posts
    911

    Re: QML Facebook authentication

    Quote Originally Posted by yokascript View Post
    Hello,
    I've released a little component that might help you all to use FB authentication in your application.
    You can find it https://github.com/yoka/QMLFB
    Thanks for the code.
    But Why are you not trying Qt Wiki Section to showcase your article on this topic with some sample code/screenshot or try Forum Nokia Project ?
    Nokia Developer Wiki Moderation team
    World's Greatest Speeches for Windows Phone is now available on WP Marketplace.

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    Re: QML Facebook authentication

    Quote Originally Posted by chintandave_er View Post
    Thanks for the code.
    But Why are you not trying Qt Wiki Section to showcase your article on this topic with some sample code/screenshot or try Forum Nokia Project ?
    I urged to get this out as early as I can so that the community can start using it. Now that the basic implementation is finished it's easy to update the Facebook component to projects that are using it when I push more updates to git.

    I might do a wiki article a bit later, but first I'm going to add more features from graph API.

    edit:
    As for the Nokia project, I cannot participate for the fact that I do not have Symbian device (or any Nokia phone) at the moment. I wish I get one some day so I can really put some effort to Qt Quick scene.
    Last edited by yokascript; 2011-02-02 at 12:17.

  6. #6
    Registered User
    Join Date
    Oct 2004
    Posts
    89

    Re: QML Facebook authentication

    Hi Yoka

    I tried your code for Qt Windows and It works like a charm.
    I will try it on N8 device also

    -halderp

  7. #7
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    Re: QML Facebook authentication

    Thank you for your response. I'm planning on updating it this weekend. Some graph api functions and faster authentication mechanism are to be expected.

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: QML Facebook authentication

    Hi yokascript,

    hosting your code on FN Projects ( https://projects.forum.nokia.com/ ) as a possible alternative to GitHub, or creating a wiki article in which to present this (and/or other) QML creation(s) will give you a chance to win a Nokia smartphone, through The Quick Competition 2011 . For testing you can use the RDA service.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  9. #9
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    Re: QML Facebook authentication

    Due to Qt becoming useless in Nokia phones I feel no longer passion in continuing this project. If Nokia decides to ditch M$ and continue with Qt based platforms, I might return to this.

    It was fun to learn QML and it was very promising environment. But I as a developer do not trust that there's any future for QML anymore. I will not do this just to support some Symbian phones that are about to be discontinued soon.

    My personal wish would be that Nokia would actually dump all the other platforms except MeeGo. But that is not going to happen, shareholder driven company as it is.

    Thank you.

  10. #10
    Registered User
    Join Date
    Jan 2012
    Posts
    3

    Re: QML Facebook authentication

    hi friend, try to run this example and this error occurs to me:

    [Qt Message] CSymbianCertificateRetriever: failed to retrieve a certificate, error -46

    you ca help me, why ocurred this problem??...


    thanks!!!




    Quote Originally Posted by yokascript View Post
    Hello,

    I've released a little component that might help you all to use FB authentication in your application.

    You can find it https://github.com/yoka/QMLFB


    Here's the readme to give you all some idea what it does:

    Code:
    /*
    *
    *
    *   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.

    If you like this, let me know. Feel free to fork me @ github if you got some cool ideas or something.. And of course if you're from Nokia you could send me some new Nokia phones so I can run native.

    Have fun!

  11. #11
    Nokia Developer Expert
    Join Date
    Sep 2011
    Posts
    382

    Re: QML Facebook authentication

    The KErrPermissionDenied (-46) is a result of missing capabilities. Please check the project pro-file.

  12. #12
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: QML Facebook authentication

    If the project capability adjusting does not help (you need Networking --- and i as far as i know for Symbian Qt Creator makes it by default if project does not declare capabilities at all --- i have seen such behaviour) , it might be different reason though , this bug report claims this warning -46 is not fatal https://bugreports.qt-project.org/browse/QTBUG-16834

  13. #13
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    Re: QML Facebook authentication

    how to import & use speech to text in qml pls reply

  14. #14
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: QML Facebook authentication

    Hi

    Harmattan and Symbian have no such feature. For Symbian there is party apps like Vlingo. No API is provided. There is an unofficial Google Speech API that is used in a Symbian app . some more about the API Since it is unofficial it can be changed or stop working at any moment.

    As for exposing to QML side any functionality from mobile --- please check documentation how to combine C++ and QML. The general approach is you need to implement QML plugin in C++

Similar Threads

  1. [Qt QML] Questions regarding QML Performance
    By SeanZhang in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-05-05, 13:07
  2. Replies: 1
    Last Post: 2010-05-31, 16:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×