×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Apr 2011
    Posts
    53

    facebook link not accepting "&" i.e ampersand when i post the link through my app

    hello friends,I am working on app where i have to post the video link to facebook,so i have used the postfeed project for facebook which is present in git repository,my link appears in the below way
    http://xyz.abc.com.aspx?streamid=223322&id=1400...
    now it accepts till http://xyz.abc.com.aspx?streamid=223322
    and i can post the link till here,but as soon as i add the later part ie&id=1400,its not posting it,so what is the problem with that "&",please help me out..



    regards
    anshuman

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    "&" needs to be escaped in virtually all scenarios where it's transmitted as pure text. Precisely how you escape it depends on how the text is being transmitted -- sometimes as "&amp.", sometimes with % encoding, etc.

  3. #3
    Regular Contributor
    Join Date
    Apr 2011
    Posts
    53

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    the code i have written is like this..u please check where i have done mistake..

    void VideoPage::shareOnFacebook()
    {

    PostFeed *pPostFeed=new PostFeed;
    QUrl url;
    url.setUrl("http://xyz.abc.com.aspx?");


    url.addQueryItem("streamid", video.url);
    url.addQueryItem("id","1400");
    url.addQueryItem("type","video-mp4");//mp4
    url.addQueryItem("redirect","false");
    pPostFeed->setPostText(url.toString());
    pPostFeed->showFullScreen();


    }

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    Well, one would need to see the documentation for PostFeed, wouldn't one?

  5. #5
    Regular Contributor
    Join Date
    Apr 2011
    Posts
    53

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    hello dan

    actually i tried this code..

    QUrl url;
    url.setUrl("http://xyz.abc.com.aspx?");


    url.addQueryItem("streamid", video.url);
    url.addQueryItem("%26id","1400");
    url.addQueryItem("%26type","video-mp4");
    now link is share to facebook but only thing is that it only takes the link before "&" means if i pass
    http://xyz.abc.com.aspx?streamid=643646&id=1900 then it share upto

    http://xyz.abc.com.aspx?streamid=643646..so hw can i resolve this..

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    addQueryItem is inserting & characters, even when you specify %26. Either construct your own query string or apply % encoding to the string you extract from uri.

    Hint: Print out what you get from uri.toString, and make sure (after you further process it as needed) that there are no & characters in it.

  7. #7
    Regular Contributor
    Join Date
    Apr 2011
    Posts
    53

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app

    Actually that thing i dont know how to do..after extracting string from the uri..how can i set % encodding to that string..please give me some idea..

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: facebook link not accepting "&" i.e ampersand when i post the link through my app


Similar Threads

  1. Make call when the link has "CallTo://" protocol..
    By rajani_sp1 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2008-03-14, 09:03
  2. Replies: 0
    Last Post: 2006-08-25, 07:24
  3. Replies: 0
    Last Post: 2006-08-25, 07:19
  4. Replies: 0
    Last Post: 2005-09-14, 15:51
  5. the "messages" crashed when my app return
    By dt10000 in forum Symbian C++
    Replies: 0
    Last Post: 2003-05-29, 09:16

Posting Permissions

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