2013-12-20 60 views
8

我试图使用从Google+到Google+应用的深度链接,然后输入http://developers.google.com/+/mobile/android/share/deep-link将链接深度链接到Google+,但链接没有任何作用

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

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

我已经在谷歌开发者控制台项目凭证启用深层链接。

我使用一个签名,与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 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"); 
    } 
} 

我正在构建发行密钥库并在运行4.4的多个实际设备上进行测试。

我已经试过:

  • 使用PlusShare.Builder(activity)构造函数(不plusClient),没有变化。使用addCallToAction(label, uri, deeplink)代替setContentDeepLinkId。没有号召性用语按钮,点击帖子后转到uri而不是深度链接。

  • 在开发人员控制台中正确设置三重检查“深层链接:已启用”。

  • 建设没有proguard,没有变化。

  • 卸载应用程序然后点击链接(应该打开Play商店条目),什么也不做。

  • 使用不同的密钥签名。加号登录失败(按预期)。

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

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

  • 获取我的API访问令牌并验证它有auth/plus.login,它的确如此。

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

更新:这现在正在工作,显然是由Google Play服务更新修复的。

+0

仍在更新到谷歌播放服务(对设备和应用的build.gradle)4.1.32后失败。 – Darrell

回答

0

它通常最好共享一个标记为schema.org的URL,而不是传递标题,描述和图像。由于没有URL,链接将永远不会在网页上点击(您需要使用setContentURL才能拥有该链接) - 但它应该在Android上打开应用程序。

这就是说,未定义确实看起来可疑。这里有两件事情,第一件是链接不起作用,第二件说明不再以普通股形式显示。 Android的交互式帖子存在一个已知问题,希望在新的一年的早些时候解决,我想知道这是否也影响了深度链接的共享。为了缩小范围,您可以尝试使用schema.org标记setContentURL中的URL(例如https://developers.google.com/+/web/snippet/examples/thing),并在setContentDeeplink调用上传递null作为标题,图像和描述吗?

+0

只是为了确保这是我的错误,而不是基础设施问题,你能指点我的应用程序共享和接收深层链接吗?我一直无法制作我的最小测试应用程序和Google照片搜索示例。谢谢! – Darrell