【问题标题】:Google+ api sharing interactive posts twiceGoogle+ api 两次分享互动帖子
【发布时间】:2014-01-18 16:19:25
【问题描述】:

在我的安卓应用中,我想让用户分享互动帖子。所以我使用https://developers.google.com/+/mobile/android/share/interactive-post中给出的代码

PlusShare.Builder builder = new PlusShare.Builder(this, monPlusClient);
builder.addCallToAction("DISCOVER", Uri.parse(target), ident);
builder.setContentUrl(Uri.parse(target));
builder.setContentDeepLinkId(ident, topic.getNomPeintre(), desc,
            Uri.parse(topic.getLien()));
builder.setText(texte + " #Art");
Intent shareIntent = builder.getIntent();
startActivityForResult(shareIntent, SHAREGPLUS_REQUEST_CODE);

我与 Google+ API 建立了完全可操作的连接(密钥正常)。

问题是我可以在 Google+ 中看到我的帖子两次。

为什么?

我的测试环境:

  • Android 4.4.2 build KOT49H 下的Nexus 7 物理设备
  • Google Play 服务版本 4.1.32 (978161-30)
  • Android SDK 管理器:Google Play 服务版本 14

【问题讨论】:

    标签: android google-api google-plus


    【解决方案1】:

    面临类似的问题。这是因为同时具有 setContentUrl 和 setContentDeepLinkId。您可以根据自己的要求使用一种,例如交互式或非交互式共享内容。

    【讨论】:

    • 我不太明白,如果不使用setContentUrl,会报错:java.lang.IllegalStateException: The content URL is required for interactive posts.
    • 是的,如果您需要交互式帖子,请使用 setContentUri 而不要使用 setContentDeepLinkId()。 Google-plus 会从您提供的链接中检索内容并生成一篇互动帖子。
    猜你喜欢
    • 1970-01-01
    • 2014-09-19
    • 2013-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    • 2016-09-24
    相关资源
    最近更新 更多