When I share text on Facebook via Intent --> Facebook app it appears on FB with "Shared via Facebook for Android". Im wondering if I can change it to "Shared via A开发者_运维知识库ppName for Android". ? Have a great day everyone ! :)
Of course you can...
- Create an application on facebook
- Downlaod the facebook sdk for android
- Add to your class
Facebook facebook = new Facebook("your_add_id");
Add this code to publish
facebook.authorize(this, new String[] { "email", "read_stream" }, new DialogListener() { public void onComplete(Bundle values) {} public void onFacebookError(FacebookError error) {} public void onError(DialogError e) {} public void onCancel() {} }); Bundle parameters = new Bundle(); parameters.putString("message", "Test Photo"); parameters.putString("attachment", "{\"name\":\"My Test Image\"," +"\"href\":\""+"http://www.google.com"+"\"," +"\"media\":[{\"type\":\"image\",\"src\":\""+"http://www.google.com/logos/mucha10-hp.jpg"+"\",\"href\":\""+"http://www.google.com"+"\"}]" +"}"); facebook.dialog(this, "stream.publish", parameters, null);
this is the code to publish a link or image I forgot .. anyway this is just an idea
精彩评论