使用Google PlusShare共享时,不会显示Google Play中的应用的默认图片

时间:2015-11-08 10:30:24

标签: android google-plus google-play-services google-plus-one

当用户点击Android应用程序中的G +时,它应该获取PLUS SHARE文档中所示的图像。但它没有显示我的应用程序的任何图像。 enter image description here

enter image description here

请您告诉我代码中需要修复的内容

字符串值

<string name="plus_example_deep_link_id">
    https://play.google.com/store/apps/details?id=com.egg.catcher.fun</string>
<string name="plus_example_deep_link_url">
    https://play.google.com/store/apps/details?id=com.egg.catcher.fun
</string>

代码

    private Intent getInteractivePostIntent() {
    // Create an interactive post with the "VIEW_ITEM" label. This will
    // create an enhanced share dialog when the post is shared on Google+.
    // When the user clicks on the deep link, ParseDeepLinkActivity will
    // immediately parse the deep link, and route to the appropriate  
   resource.
    String action = "/?view=true";
/*
    Uri callToActionUrl = Uri.parse(getString(R.string.plus_example_deep_link_url) + action);
    String callToActionDeepLinkId = getString(R.string.plus_example_deep_link_id) + action;
*/

    Uri callToActionUrl = Uri.parse(getString(R.string.plus_example_deep_link_url));
    String callToActionDeepLinkId = getString(R.string.plus_example_deep_link_id);

    // Create an interactive post builder.
    PlusShare.Builder builder = new PlusShare.Builder(this);

    // Set call-to-action metadata.
    builder.addCallToAction(LABEL_VIEW_ITEM, callToActionUrl, callToActionDeepLinkId);

    // Set the target url (for desktop use).
    builder.setContentUrl(Uri.parse(getString(R.string.plus_example_deep_link_url)));

    // Set the target deep-link ID (for mobile use).
    builder.setContentDeepLinkId(getString(R.string.plus_example_deep_link_id),
            null, null, null);

    // Set the pre-filled message.
    builder.setText(mEditSendText.getText().toString());

    return builder.getIntent();
}

0 个答案:

没有答案