本文介绍了使用 android sdk 在 Google Plus 上分享照片,而不是通过 Share Intent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用它的 android sdk 集成了 Google+,并且还能够获取 PlusClient 对象.我从这里获得了基本信息.在底部的同一页面中,还有另一个交互式帖子链接,我从中获得了以下共享内容的代码.但它的打开对话框然后分享它.

I have integrated Google+ using its android sdk and able to get PlusClient object as well.I got basic information from here. In the same page at bottom there is another link for interactive post from where i got the below code which share the content. But its opening dialog and then share it.

代码:-

Button shareButton = (Button) findViewById(R.id.share_button);
shareButton.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
      // Launch the Google+ share dialog with attribution to your app.
      Intent shareIntent = new PlusShare.Builder(this)
          .setType("text/plain")
          .setText("Welcome to the Google+ platform.")
          .setContentUrl(Uri.parse("https://developers.google.com/+/"))
          .getIntent();

      startActivityForResult(shareIntent, 0);
    }
});

我的情况不同,因为我的应用程序中已经有图像和文本,我只想在 Google+ 上共享它们而无需任何用户交互(想要共享它的用户的登录名/签名除外).在分享照片+文字后,我将立即删除/清除用户的登录信息.所以我只想要求用户进行身份验证,并且不应该出现共享对话框.将有一个按钮名称在 G+ 上分享,单击该按钮应用程序将要求用户进行身份验证并分享用户已选择的照片+文字.

My case is different as I have Image and Text already with me in my app, i just want to share them on the Google+ without any user interaction (except the login/sigin of user who wants to share it). And immediately after sharing the photo+text i will remove/clear the login of the user. So i only want to ask user for the authentication and the dialog for share should not appear. There will be a single button name Share on G+ by clicking that button app will ask user for authentication and share the photo+text already selected by user.

IMP 注意:- 仅应显示用户身份验证弹出窗口,并且必须在没有任何用户交互的情况下共享照片+文本.

我需要一些指导,因为我已经集成了 android-sdk 并且我也让它工作,现在唯一的事情是在没有用户交互的情况下共享.如果有人对此有任何想法,请帮助/指导我.

I need some guidance on this as i have already integrated the android-sdk and i also have it working, Now only thing is sharing without user interaction. Please if anyone has any idea on this kindly help/guide me.

推荐答案

这是不可能的.分享到 Google+ 必须始终由用户发起,这最终会在其他用户从您的应用中看到分享时提供更好的用户体验 - 他们知道分享内容适合他们.

This is not possible. Sharing to Google+ must always be user-initiated, which ultimately makes for a better user experience when other users see a share from your app--they know that it has context for them.

用户交互实际上非常少.一旦他们点击 Share 按钮,他们将被带到一个共享对话框,其中已经包含您预先填充的内容.他们可以添加评论和一些他们认为会喜欢该帖子的人,仅此而已.

The user interaction is actually pretty minimal. Once they hit the Share button, they will be taken to a share dialog that already has the content you have pre-populated. They can add a comment and some people they think would enjoy the post, and that's it.

这篇关于使用 android sdk 在 Google Plus 上分享照片,而不是通过 Share Intent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 19:24