开发者

Sharing text via Facebook app, How to change "shared via Facebook for Android"?

开发者 https://www.devze.com 2023-03-19 21:04 出处:网络
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 Androi

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...

  1. Create an application on facebook
  2. Downlaod the facebook sdk for android
  3. Add to your class

Facebook facebook = new Facebook("your_add_id");

  1. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消