0
votes

I authenticate user to google with AccountManager and with scope "oauth2:https://www.googleapis.com/auth/plus.login".

I've sent received token to server. Server tries to make moments.insert with my token, but it receives "code": 401, "message": "Unauthorized"

Server just uses my token an "me" as user id.

Please, help: whether problem is on server side or on client side and what is the problem?

Thanks!

1

1 Answers

0
votes

First, you cannot post activity to Google+ programmatically. The app activities that you can write are specific to your application and appear on a user's profile but not in their stream.

To use app activities, you must request permissions for the types of app activities that you are writing and pass these to the Google+ client's builder:

private PlusClient mPlusClient;

private static final String[] actions = {
    "https://developers.google.com/+/plugins/snippet/examples/thing" 
};

mPlusClient = new PlusClient.Builder(this, this, this)
    .setActions(actions)
    .build();

...