我正在制作一个不需要用户帐户/登录的应用程序,并允许用户购买订阅.我想使用Google Play Developer API来验证用户是否有购买/有效订阅.从所有文档中,我收集了以下步骤.
它们是否正确,您能否回答其中的两个问题?
此外,我有一个Web服务,虽然我对Web服务或Web服务编程一无所知......我只知道它可能需要在这里使用.
编辑:这些步骤不正确.请参阅下面的答案,了解正确的步骤.但请注意,这仅适用于使用服务帐户(因为我不想要求用户必须明确允许API访问)
当我在Google Developers Console中使用Google Play Android Developer API测试购买产品的状态时,会发生这种情况,结果总是如此
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Run Code Online (Sandbox Code Playgroud)
使用另一个开发者帐户(和包名称)检查了这一点,它工作得很好.我确定已将Google开发者控制台的API项目与Google Play开发者控制台 - > API访问设置相关联,并尝试尽可能多地重新创建,但没有任何项目有效.
那我在这里错过了什么?除了我在Google Play控制台设置中制作的链接项目外,它的含义是什么"无法链接".
我想发展我的用户的应用内购买和订阅的服务器端验证的建议,我想用火力地堡功能为.基本上它必须是一个HTTP触发器函数,它接收购买令牌,调用Play Developer API来验证购买,然后对结果做一些事情.
但是,调用许多Google API(包括Play Developer API)需要进行非平凡的授权.以下是我理解所需设置的方法:
问题是绝对没有人类可读的文档或指导.鉴于Firebase中的入口流量包含在免费计划中(因此我假设他们鼓励使用Firebase功能中的Google API),这一事实非常令人失望.我已经设法在这里和那里找到一些信息,但是对于谷歌API的经验太少(大多数只需要使用api密钥),我需要帮助将它放在一起.
这是我到目前为止所发现的:
我很惊讶没有被询问或记录,因为从Firebase功能验证应用内购买似乎是一项常见任务.有没有人成功完成它,或者Firebase团队可能会介入回答?
google-api firebase google-api-nodejs-client google-play-developer-api google-cloud-functions
在尝试获取Android应用内订阅状态(有效期限)时,我收到以下错误消息:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Run Code Online (Sandbox Code Playgroud)
该网址为:https://www.googleapis.com/androidpublisher/v2/applications/[packageName]/inapp/ [productId]/purchases/[purchase_token]?access_token=[access_token]
它说项目ID没有链接.我做了以下事情:
Run Code Online (Sandbox Code Playgroud)1. Create the project in Google Developer Console. 2. …
当我使用Google API v2时,为了获得一个inapp列表,我在进行API调用时遇到以下错误:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Run Code Online (Sandbox Code Playgroud)
然后我研究了这个错误,最后看到了这个页面,这个页面以及这个页面上的建议.我跟着并仔细检查了项目在那里的链接方式,但没有帮助.
这就是我做的......
在Google Developer Console中:
我正在使用 Google Play Developer Console 帐户的 v2。
我转到在线 API 资源管理器进行新的编辑。
我在packageName字段中输入我的包名称 (com.companyname.appname) ,点击“执行”,然后收到此403错误响应:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Run Code Online (Sandbox Code Playgroud)
我实际上确实链接了我的 …
我们正在使用Android中的应用内购买来实现订阅,我们正在获得购买时间戳,格式如下
'{
"orderId":"GPA.1234-5678-9012-34567",
"packageName":"com.example.app",
"productId":"exampleSku",
"purchaseTime":1345678900000,
"purchaseState":0,
"developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
"purchaseToken":"opaque-token-up-to-1000-characters"
}'
Run Code Online (Sandbox Code Playgroud)
但是我们需要在应用程序UI中显示到期日期,我们想从Play商店获取确切的到期日期。我们假设,如果我们手动计算有效期限,则可能与Play商店的有效期限发生冲突。谁能解释“如何在Android中获取订阅的到期日期?”
android subscription in-app-purchase auto-renewing android-studio
我正在尝试使用以下API下载针对Android Apps的评论。 https://developers.google.com/android-publisher/api-ref/reviews
但这需要身份验证。因此,我按照上面链接中链接的说明进行操作。
我能够获得访问令牌。
但是我得到以下回应:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Run Code Online (Sandbox Code Playgroud)
我看到其他一些帖子说,您必须将其与Google Play开发者控制台关联。所以我做到了(见下图)。
[
]
但是我仍然收到此错误。请帮忙。
google-api google-api-client google-console-developer google-play-developer-api google-developers-console
google-api ×6
android ×5
google-play ×4
subscription ×3
firebase ×1
in-app ×1
php ×1
service ×1