2

I used following code to share post on google plus in android app. But It does not shows description of snippet.It shows everything except description.Is there any reason of this?

Intent shareIntent = new PlusShare.Builder(this)
            .setText("Test")
            .setType("text/plain")
            .setContentDeepLinkId(
                    "Example",  /** Deep-link identifier */
                    "Snippet",  /** Snippet title */

     // ------------ Below Desciption is not visible in post --------------

                    "Good Example", /** Snippet description */

                    Uri.parse("https://www.example.com/snippet.png"))
            .getIntent();
    startActivityForResult(shareIntent, POST_ON_GOOGLE_PLUS);

Any help will be appreciated.

Ponting
  • 2,248
  • 8
  • 33
  • 61

1 Answers1

1

Verify that you have enabled deep linking in the Google APIs Console under Client ID for installed applications.

If that is enabled for your Android client, try and see if the sample code from the documentation works, I just tested it and it works for me:

    PlusShare.Builder builder = new PlusShare.Builder(this, mPlusClient)
    .setText("Lemon Cheesecake recipe")
    .setType("text/plain")
    .setContentDeepLinkId("/cheesecake/lemon", /** Deep-link identifier */
            "Lemon Cheesecake recipe", /** Snippet title */
            "A tasty recipe for making lemon cheesecake.", /** Snippet description */
            Uri.parse("http://example.com/static/lemon_cheesecake.png"))
     .getIntent();

Something to note:

  • PlusShare.Builder(this) will use an unauthorized client and will fallback to a regular share.

If you don't pass the client the following will not work:

  • Prefilling recipients
  • Specifying the snippet
  • Setting the call to action button

I'm guessing this is why the interactive post is not rendering correctly for you. Make sure to pass your authorized API client.

class
  • 8,621
  • 29
  • 30
  • Yes,I have deeolinking enabled in Google Plus API Console .I have tried with this,only change when i tries with this code is that I have PlusShare.Builder builder = new PlusShare.Builder(this) in place of PlusShare.Builder builder = new PlusShare.Builder(this, mPlusClient) .So is there any difference between these two? – Ponting Aug 17 '13 at 03:11
  • I don't know, I will see what I can figure out. – class Aug 17 '13 at 03:16
  • Ok.Let me know when you come up with solution. – Ponting Aug 17 '13 at 03:18
  • Again, does the sample code I put up there work? If not, the problem is not the section of code where you are creating the sharebuilder. – class Aug 19 '13 at 20:49
  • Just tested again and figured out the difference between Builder(this) vs Builder(this, mPlusClient) – class Aug 19 '13 at 21:35
  • No,Builder(this) and Builder(this, mPlusClient) gives me same result. – Ponting Aug 21 '13 at 12:33