【问题标题】:Snippet Description is not displayed in Google Plus Post (Android)Google Plus Post (Android) 中不显示片段说明
【发布时间】:2013-08-16 16:57:41
【问题描述】:

我使用以下代码在 google plus 上在 android 应用中分享帖子。但是它没有显示sn-p的描述。它显示了除了描述之外的所有内容。这有什么原因吗?

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

我们将不胜感激。

【问题讨论】:

    标签: android share google-plus posting field-description


    【解决方案1】:

    确认您已在Google APIs Console 下的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) 将使用未经授权的客户端,并将回退到常规共享。

    如果你不通过客户端,以下将不起作用:

    • 预填收件人
    • 指定 sn-p
    • 设置号召性用语按钮

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

    【讨论】:

    • 是的,我在 Google Plus API 控制台中启用了 deeolinking。我已经尝试过这个,当我尝试使用这个代码时唯一的改变是我有 PlusShare.Builder builder = new PlusShare.Builder(this)代替 PlusShare.Builder builder = new PlusShare.Builder(this, mPlusClient) 。那么这两者有什么区别吗?
    • 我不知道,我会看看我能弄清楚的。
    • 好的。当你想出解决方案时告诉我。
    • 再一次,我放在那里的示例代码有效吗?如果不是,则问题不在于您创建共享构建器的代码部分。
    • 刚刚又测试了一下,发现Builder(this) vs Builder(this, mPlusClient)的区别
    猜你喜欢
    • 2014-05-05
    • 2012-09-07
    • 2023-03-26
    • 2013-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-17
    • 1970-01-01
    相关资源
    最近更新 更多