No data returned in intent while using Google+

懵懂的女人 提交于 2019-12-22 05:26:39

问题


I am working on an android application. I require following:

1.Post something on google plus.

2.After sometime I want to count +1's and total shares of my post.

I am doing it like this(as suggested in samples given in android sdk)

 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;
    // Create an interactive post builder.
 PlusShare.Builder builder = new PlusShare.Builder(this, mPlusClient);
    // 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());
 Intent intent=  builder.getIntent();
 startActivityForResult(intent, REQUEST_CODE_INTERACTIVE_POST);

Every thing goes fine and I receive this dialogue to share and I can successful share my contents on google plus account

But Problem comes here as the dialogue dismiss my onActivityResult get called and I expect some url or postId of that post so that I can find it for some further processing

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
       // I am expecting some data in intent but intent is always null
    }

But intent is always null. So I just want to ask

1.Is it possible to moniter a post, shared on google plus using android code ?(Yes / No)

2.If possible then what should I do ?

来源:https://stackoverflow.com/questions/22505641/no-data-returned-in-intent-while-using-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!