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.

4

1 回答 1

1

确认您已在Google API 控制台中的Client ID for installed applications.

如果为您的 Android 客户端启用了该功能,请尝试查看文档中的示例代码是否有效,我刚刚对其进行了测试,它对我有效:

    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();

需要注意的一点:

  • PlusShare.Builder(this)将使用未经授权的客户端,并将回退到常规共享。

如果您不通过客户端,则以下内容将不起作用:

  • 预填收件人
  • 指定片段
  • 设置号召性用语按钮

我猜这就是交互式帖子无法为您正确呈现的原因。确保通过您的授权 API 客户端。

于 2013-08-17T01:46:12.407 回答