Loginov
Loginov

Reputation: 11

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

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 AppName for Android". ? Have a great day everyone ! :)

Upvotes: 1

Views: 4712

Answers (1)

Sherif elKhatib
Sherif elKhatib

Reputation: 45942

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

Upvotes: 2

Related Questions