【发布时间】:2018-08-09 20:48:07
【问题描述】:
经过一些研究,我设法使用了来自谷歌的 AndroidPublisher api,并且能够从我的 Java 网络应用程序连接到谷歌开发者控制台。但似乎,因为我没有任何 google play 帐户(在 play 商店中没有任何应用程序),我无法从 android 发布者 api 获得任何东西。我只是能够连接控制台。 但我在这里关心的不是获取我开发的任何应用程序的信息,而是获取已经在 Play 商店中的任何应用程序的信息。目前我想要评论。 到目前为止,我已经尝试过:
/** Global instance of the JSON factory. */
JsonFactory JSON_FACTORY = (JsonFactory) JacksonFactory.getDefaultInstance();
/** Global instance of the HTTP transport. */
HttpTransport HTTP_TRANSPORT = (HttpTransport) GoogleNetHttpTransport.newTrustedTransport();
GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream("AppReviews-08a95e474894.json"))
.createScoped(Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER));
AndroidPublisher androidPublisher = new AndroidPublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY ,credential).setApplicationName("Dream League Soccer").build();
AndroidPublisher.Reviews reviews = androidPublisher.reviews()
println "reviews --------------------= ${reviews.list("com.firsttouchgames.dls3").setMaxResults(500).execute()}"
当它执行时,我得到以下异常:
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "androidpublisher",
"message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"reason" : "projectNotLinked"
} ],
"message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
我认为这意味着,我的 Google 开发者控制台项目/帐户中没有关联任何 Google Play 帐户。
那么,我必须要有一个 google play 帐户吗?即使我在 google play 中有一个帐户,我也可以访问全球应用程序的评论(就像我在上面的示例中使用了 Dream League Soccer 并具有正确的包名称)。
请帮助,找不到任何资源,或以前提出的相关问题的任何答案。 请帮忙!
【问题讨论】:
-
你试过检查这个SO post吗?
标签: java google-play-services google-play-developer-api google-play-console