×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Facebook and Twitter in QML

    HI,
    I am trying to share things on FB and Twitter from my QML application, is this possible? I just check the SDK and found there is one example for Twitter, is there any other example like that.
    i got this links
    http://www.developer.nokia.com/Community/Wiki/QML_OAuth
    http://www.developer.nokia.com/Commu...library_for_Qt


    I know a bit to access twitter with Javascript. I am looking for any example in QML


    any idea please
    Last edited by somnathbanik; 2011-08-19 at 16:55. Reason: added

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Facebook and Twitter in QML

    hello Somnath

    For Facebook you can simply use OAuth2 which works good with the QML Webview please follow these links

    1. http://www.developer.nokia.com/Commu...authentication
    2. http://www.johanpaul.com/blog/2011/0...with-qt-quick/

    For Twitter you can use some javascript libraries available or you can try using KQOAuth which works very good with twitter but the only concerned is you need to use it by taking all its source files as its has some problems when compiling the library for symbian.

    Hope this helps you.

    Regards,

  3. #3
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Facebook and Twitter in QML

    I already tried this example yesterday http://www.developer.nokia.com/Commu...authentication
    But then app turns the screen and the fb doesn't comes up, i have added my app ID.

  4. #4
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Facebook and Twitter in QML

    I have used javascript in s40 web app to implement twitter, i can use the same javascript in qml also for twitter, but I am bit confuse with the facebook.
    Could anyone please put some light on facebook implementation.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Facebook and Twitter in QML

    hello somnath,

    my aplogies for replying you late, at present as weekend is going on i am not in a position to check that code. But to be frank that used to work with me and i have an application dependent on that and still it works.

    So just try to understand the code its not that much long and you will get it why it doesnt work.

    Otherwise did you tried the second link it has a similar example.

  6. #6
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Facebook and Twitter in QML

    Quote Originally Posted by gaba88 View Post
    hello somnath,

    my aplogies for replying you late, at present as weekend is going on i am not in a position to check that code. But to be frank that used to work with me and i have an application dependent on that and still it works.

    So just try to understand the code its not that much long and you will get it why it doesnt work.

    Otherwise did you tried the second link it has a similar example.
    Hi Gargi,
    I have tried both the links, even I tried this project http://projects.developer.nokia.com/kasvopus. There are some sis file, but all the time I am not able to login , getting some error message " Error Facebook Api 400 bad request" . As you said you have done some things with the code in Facebook, do you mind to help me where I am making mistake, is there any settings need to be made in the facebook website for my application

  7. #7
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Facebook and Twitter in QML

    I run the project of my post #6 and found that its not running and coming up with some error message .
    I figure out the error message: it the HTTP status message, it should be 200 but coming to be 400.
    here is the code
    Code:
    function doWebRequest(method, url, params, callback) {
        var doc = new XMLHttpRequest();
       // console.log(method + " " + url);
        doc.onreadystatechange = function() {
            if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
                var status = doc.status;
                if(status!=200) {
                    console.log("Status:"+status);
                    showError("Facebook API returned " + status + " " + doc.statusText);
    
                    //console.log("StatusText:"+doc.statusText);
                }
            } else if (doc.readyState == XMLHttpRequest.DONE) {
                var data;
                var contentType = doc.getResponseHeader("Content-Type");
                data = doc.responseText;
                callback(data);
            }
        }
        doc.open(method, url);
        doc.send();
    }
    its javascript code, I am not good in javascript so if anyone could see and help me please

  8. #8
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Facebook and Twitter in QML

    I have used the "TwinGo" project https://projects.developer.nokia.com.../TwimGo/js/lib
    This allows me to run on the desktop but its not login on the device, (N8), could any one put some light on it

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

    Re: Facebook and Twitter in QML

    hi... someone post development functions for facebook and twitter?

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

    Re: Facebook and Twitter in QML

    This would be a good start to implement such clients.

  11. #11
    Registered User
    Join Date
    Jul 2004
    Posts
    166

    Re: Facebook and Twitter in QML

    I had used this code for one of my Qt application to post message on facebook.

    It might help (http://kunalmaemo.blogspot.com/2012/...l-from-qt.html)
    http://kunalmaemo.blogspot.com/

Similar Threads

  1. freelancer needed: Facebook/Twitter interfacing
    By real_lingchen in forum News and Announcements
    Replies: 3
    Last Post: 2011-06-30, 10:23
  2. Facebook, Twitter or Barcode API Support in Qt for Symbian/Maemo ?
    By narendar_discover in forum [Archived] Beginning Qt
    Replies: 14
    Last Post: 2011-05-16, 16:45
  3. Facebook and Twitter Problem.
    By pokoot in forum Symbian
    Replies: 1
    Last Post: 2010-09-11, 07:07
  4. Replies: 4
    Last Post: 2010-05-25, 13:53

Posting Permissions

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