Question

Reading the documentation it is unclear to me how to get a token from either android or appengine endpoint server? I assume they mean by token a oauth2 access token?

https://developers.google.com/android-publisher/v1_1/ http://developer.android.com/google/play/billing/gp-purchase-status-api.html

I did setup a client id like this

console

In javascript I can get a access token gapi.auth.getToken().access_token. But is it the same token? What scope do I need? Is there a API I need to activate in the console?

On appengine I only know how to get a email from the user.

var clientids = []string{WEB_CLIENT_ID, ANDROID_CLIENT_ID_d, ANDROID_CLIENT_ID_r, endpoints.ApiExplorerClientId}
var audiences = []string{WEB_CLIENT_ID}
var google_scopes = []string{"https://www.googleapis.com/auth/userinfo.email"}

func (s *Service) Google(r *http.Request, req *NoRequest, resp *User) error {
        c := endpoints.NewContext(r)
        g, err := endpoints.CurrentUser(c, google_scopes, audiences, clientids);
        if err != nil {return err}
        resp.Email=g.String()
        return nil
}

Can you provide me more info about the token I must use to verify a purchase (in-app-billing v3)?

Was it helpful?

Solution

Never mind I found it, mist this reference :) https://developers.google.com/android-publisher/authorization

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top