Sto cercando di ottenere un token di accesso per utilizzare Google Play per sviluppatori Android API, e ho ottenuto fino a questo punto usando the Google API Java Client documentation example:Come ottenere il token di accesso da GoogleCredential?
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(HTTP_TRANSPORT)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId("...gserviceaccount.com")
.setServiceAccountScopes("https://www.googleapis.com/auth/androidpublisher")
.setServiceAccountPrivateKeyFromP12File(keyFile)
.build();
Ma come faccio a ottenere il token di accesso da questa credenziale? credential.getAccessToken()
restituisce null
. Sto facendo qualcosa di sbagliato o mi manca qualche passaggio?
Controllare anche http://stackoverflow.com/a/24264696/165708 ulteriori passaggi che potrebbero essere necessari per far funzionare tutto. –