android - 深层链接分享到 Google+,但链接不执行任何操作

标签 android google-plus deep-linking

我正在尝试使用从 Google+ 到 Android 应用程序的深层链接,遵循 http://developers.google.com/+/mobile/android/share/deep-link .

我可以分享到 Google+。帖子中的链接是“可点击的”(它在触摸时突出显示),但在发布时什么也不做。此外,该帖子包含可疑的“未定义”文本行。

sample http://raw.github.com/concreterose/TestDeepLink/master/README_ASSETS/sample_share.png

我已在 Google Developers Console 项目凭据中启用深度链接。

我正在使用通过 Scopes.PLUS_LOGIN 创建的已登录 PlusClient,发布方式:

Intent shareIntent = new PlusShare.Builder(this, plusClient)
    .setText("Testing deep link")
    .setType("text/plain")
    .setContentDeepLinkId("deeplink",
         "title",
         "description",
         Uri.parse(thumbnailUrl))
    .getIntent();
startActivityForResult(shareIntent, 0);

我不确定我是否需要所有这些,在尝试让事情正常运行时我有:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

处理 Activity (作为 list 中的第一个 Activity 给出):

    <activity android:name=".ParseDeepLinkActivity">
        <intent-filter>
            <action android:name="com.google.android.apps.plus.VIEW_DEEP_LINK" />
            <data android:scheme="vnd.google.deeplink" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    </activity>

是:

public class ParseDeepLinkActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(TAG, "onCreate");
        throw new RuntimeException("got here");
    }
}

我正在使用发布 keystore 进行构建,并在几台运行 4.4 的真实设备上进行测试。

我试过:

  • 使用 PlusShare.Builder(activity) 构造函数(没有 plusClient),没有变化。

  • 使用 addCallToAction(label, uri, deeplink) 而不是 setContentDeepLinkId。没有号召性用语按钮,点击帖子会转到 uri 而不是深层链接。

  • 三次检查“深层链接:已启用”是否在开发者控制台中正确设置。

  • 没有混淆的构建,没有变化。

  • 卸载应用然后点击链接(应该打开 Play 商店入口),什么都不做。

  • 使用不同的 key 签名。 Plus 登录失败(如预期)。

  • 使用不同版本的播放服务(4.0.30 与 3.2.+)。

  • adb shell setprop log.tag.GooglePlusPlatform VERBOSE 不生成任何日志消息。

  • 获取我的 API 访问 token 并验证它有 auth/plus.login,它有。

谁能告诉我我做错了什么?谢谢!!

更新:现在可以正常使用,显然已通过 Google Play 服务更新修复。

最佳答案

事实证明这是一个已知问题,将在下一次 Google+ 更新中解决:

Google+ Interactive shares on android are broken in version 4.2.4.58179886

关于android - 深层链接分享到 Google+,但链接不执行任何操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20695264/

相关文章:

android - ListView 的 subview 有两种不同的布局

javascript - 通过任何网站插入对 Google+ 事件的评论

android - 如何为 Branch.io 提取 Sha256 证书指纹

google-play - App Store 和 Google Play 的 URL 格式,用于安装具有深度链接的应用程序

ios - 返回应用页面,来自uiwebview

android - Branch.io:点击链接时深度链接到特定 Activity

java - 如何使用 asynctask json 添加 pojo

android - 我可以检测 Android 设备上是否存在 'LED notification' 吗?

java - Android读入与app打包的.txt文件

java - 为什么 Google Apis 控制台中没有 Google+ 历史记录 API?