经过一些研究,我成功地使用了谷歌的AndroidPublisher api,并能够从我的应用程序连接到。但是看起来,由于我没有任何google帐户(在play商店没有任何应用程序),我无法从android发布api中得到任何东西。我只是能够连接控制台。但我在这里关注的不是我开发的任何应用程序的信息,而是任何已经在游戏商店中的应用程序的信息。目前我想有评论。到目前为止,我已经尝试过:
/** 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 play上有一个帐户,我也可以访问全球应用程序的评论(就像我在上面的例子中使用过有正确包名的梦想联赛足球)。
请帮助,找不到任何资源,或任何以前提出的相关问题的答案。请帮帮我!
发布于 2018-03-02 09:04:19
该API用于Android应用程序开发人员获取他们自己的应用程序的信息。这并不是为了获取所有应用程序的信息而对商店进行抓取。这个API不会做你想做的事情,它只会得到关于你自己的应用程序的信息,而且你没有。
https://stackoverflow.com/questions/49055545
复制相似问题