Tag: 谷歌播放

在服务器端validation应用内购买Android / Google

我想在Android应用程序中使用应用内购买的购买令牌来validation我自己的服务器上的谷歌服务器。 使用以下代码,我可以validation令牌,但每次都必须使用我的OAuth凭据对自己进行身份validation: class GooglePlayVerification require ‘google/api_client’ # Refer: # https://code.google.com/p/google-api-ruby-client/issues/detail?id=72 # and # http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html # and # http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/ GOOGLE_KEY = ‘xxx.apps.googleusercontent.com’ GOOGLE_SECRET = ‘xxxx’ APP_NAME = ‘xx.xx.xx’ SCOPE = “https://www.googleapis.com/auth/androidpublisher” def self.token @@token ||= begin require ‘oauth2’ raise “Missing client_id variable” if GOOGLE_KEY.to_s.empty? raise “Missing client_secret variable” if GOOGLE_SECRET.to_s.empty? raise “Missing scope variable” if SCOPE.to_s.empty? […]