title: Share Score on Facebook android
body: <p>I want to share my game score on facebook. I checked lots of links and every post people are saying that <strong>POSTING</strong> on facebook using <strong>INTENT</strong> is <strong>not possible</strong>.If we are using intent than we can <strong>share only link</strong>. </p>
  
  <p>If we have to <strong>share something on facebook</strong> than we have to use <a href="https://developers.facebook.com/docs/sharing/android" rel="noreferrer">FaceBook SDK</a>.</p>
  
  <p>I have another doubt that all questions and answers were posted <strong>before Year 2014</strong>. Is any <strong>new thing come</strong> after year 2014.</p>
  
  <p>My actual question is that, Is it possible to <strong>share score</strong> on Facebook using <strong>Intent</strong> or i have to use <strong>Facebook SDK</strong> ?</p>
  
  <p>below is the intent code which i used for my application which is not working ......</p>
  
  <pre><code>        Intent intent = new Intent(Intent.ACTION_SEND);
          intent.setType("text/plain");
          intent.putExtra(Intent.EXTRA_TEXT, message);
          startActivity(Intent.createChooser(intent, "Share on"));
  </code></pre>
  
  <p>and below is the FacebookSDK code ...and <strong>Problem</strong> in this it is <strong>not showing score</strong> on the Post <strong>only link image</strong> is showing, and <strong>title &amp; description</strong> is missing.</p>
  
  <pre><code>  FacebookSdk.sdkInitialize(getApplicationContext());
  
              shareDialog = new ShareDialog(this);
               if (ShareDialog.canShow(ShareLinkContent.class)) {
                          linkContent = new ShareLinkContent.Builder()
                                  .setContentTitle(title)
                                  .setContentDescription(description)
                                  .setContentUrl(Uri.parse(link)).
                                  .setImageUrl(Uri.parse(imageLink)   
                                  .build();
  
                          shareDialog.show(linkContent);
                      }
  </code></pre>
  
  <p>I used ShareDialog because </p>
  
  <p><strong>The Share dialog switches to the native Facebook for Android app, then returns control to your app after a post is published. If the Facebook app is not installed it will automatically fallback to the web-based dialog.</strong></p>
  
  <p>Below is the output ..........</p>
  
  <p><a href="https://i.stack.imgur.com/LZECW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LZECW.png" alt="output"></a></p>
  
  <p>@pravin this is error coming after your share API use </p>
  
  <p><a href="https://i.stack.imgur.com/7EMJR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7EMJR.png" alt="o"></a></p>
  
  <p>@Pravin this is my code of your share answer........</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          FacebookSdk.sdkInitialize(getApplicationContext());
          callbackManager = CallbackManager.Factory.create();
  
          setContentView(R.layout.activity_facebook);
  
          Button mShare= (Button) findViewById(R.id.share);
  
          mShare.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
                          .putString("og:type", "game.achievement")
                          .putString("og:title", "Name of your game")
                          .putString("og:description", "description. You can share your score here")
                          .putString("game:points", "445")
                          .build();
  
                  ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
                          .setActionType("games.achieves")
                          .putObject("game", object)
                          .build();
  
  
  
  
                  if (ShareDialog.canShow(ShareLinkContent.class)) {
                      ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
                              .setPreviewPropertyName("game")
                              .setAction(action)
                              .build();
  
                      ShareDialog.show(Facebook.this, content);
                  }
              }
          });
          shareDialog = new ShareDialog(this);
  
      }
  </code></pre>
  
  <p>Thanx in advance ................</p>