Torsten2217 / google-plus-platform

Automatically exported from code.google.com/p/google-plus-platform
0 stars 0 forks source link

Android Null intent after post created #959

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Apologize in advance if this is the incorrect topic group, but I couldn't find 
any for Google Plus API for Android.

When using PlusShare.Builder, this creates an Intent that is use to launch Plus 
screens and perform an ACTION_SEND using Google Plus windows. This is done, 
based on what documentation said 
(https://developers.google.com/+/mobile/android/share/), using 
Context.startActivityForResult method.

So, a developer will assume that as soon the Plus activities are closed, you 
would receive some data in the intent parameter in Activity.onActivityResult 
method(int,int,Intent) method. But currently null is received though.

This is what I'm using to share using Plus API

        PlusShare.Builder builder = new PlusShare.Builder(context);

        String url = Constants.DEV_HOST + "/challenge/?id=" + challenge.getId().toString();

        builder.addCallToAction("CHALLENGE", Uri.parse(url), challenge.getId().toString());
        builder.setContentUrl(Uri.parse(url));
        builder.setText("I dare you to " + challenge.getMessage());
        builder.setType("text/plain");
        context.startActivityForResult(builder.getIntent(), 100);

My Android app at this point is already signed in using Google+, and I'm able 
to share to G+ without issues
but the problem is in my Activity, when I got the onActivityResult, whenre 
Intent parameter is null

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        Log.d(TAG, "request code " + requestCode + " result code " + resultCode + " intend data" + data);
        super.onActivityResult(requestCode, resultCode, data);
    }

I'm not the only facing this problem
http://stackoverflow.com/questions/22505641/no-data-returned-in-intent-while-usi
ng-google

So my question is: Should we expect data on onActivityResultMethod? If not, 
then why documentation says we should use startActivityForResult if nothing is 
returned (succes, error, post url, etc).

Original issue reported on code.google.com by fggar...@gmail.com on 27 Aug 2014 at 4:05

GoogleCodeExporter commented 9 years ago
I've some porblem . is there a solution ?

Original comment by pasquale...@gmail.com on 5 Nov 2014 at 2:52

GoogleCodeExporter commented 9 years ago
Did you  get the solution to get post ID?

Original comment by sneh...@xcubelabs.com on 3 Apr 2015 at 6:22