douzhi1879 2014-01-15 19:54
浏览 55
已采纳

在哪里可以在Appengine或android上的App Billing v3 api中获得令牌?

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)?

  • 写回答

1条回答 默认 最新

  • doutuo1939 2014-01-16 04:55
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器