Post on Facebook wall using Facebook Android SDK without opening dialog box

前端 未结 5 1744
抹茶落季
抹茶落季 2020-11-29 19:56

Using the Facebook SDK, I can login and store my access_token into a database. When I try to create a post, the Facebook wall is still empty on both my phone an

5条回答
  •  天涯浪人
    2020-11-29 20:38

    Well it's not that something gets posted on wall without informing user. When user allows your application, then the Android Facebook sdk presents another page, where there is a text that your applications sends, and a textBox where user can write on his wall, similar to the screenshot i have attached

    The actual layout on mobile device is slightly different, but it's in the same format. This process is well shown in the sample examples of facebook android sdk.

    Now check the question asked in this post:

    Facebook Connect Android -- using stream.publish @ http://api.facebook.com/restserver.php'>Facebook Connect Android -- using stream.publish @ http://api.facebook.com/restserver.php

    In that question look for these : postParams.put(), similar type of lines will be there in some of your JAVA files. These are the lines using which you can post the data to Facebook.

    For example:

    postParams.put("user_message", "TESTING 123");
    

    is the message,

    postParams.put("attachment", "{\"name\":\"Facebook Connect for Android\",\"href\":\"http://code.google.com/p/fbconnect-android/\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}");

    is the line where you are providing icon for application, description,caption, title etc.

    alt text

提交回复
热议问题