Comments (5)
Hi Mike,
Thanks for checking out the sample and for the question! I know setting up access to the Play Developer API can be confusing so thank you for your patience.
Based on what you've shared, it sounds like you've gone through the steps in the Play Developer API section of the README already. Here are some places to double-check.
- Can you confirm the role for your service account is at least "Service account user" (you could also try giving the service account full "Owner" permissions)?
- In the "API Access" page in your Play Console, click "View access" for the service account you're using. Make sure it has access to the app you want. I think we recommend just giving it "Manage orders and subscriptions" permission, but again you could try giving the full "Admin" permissions.
- Also double-check that the service account credentials are correct in functions/src/config.ts. Make sure the service account email is the same as the one listed under "API Access". For the private key, copy the ENTIRE string as is from the key file (including the
-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----\n
parts of the string. Then deploy your backend if you made any changes.
Please let me know if it still doesn't work. Thanks!
from pwa-play-billing.
Hi @joycetoh8,
Thanks for repying so quickly, we are really at a loss how to proceed so we very much value any help you can offer.
Can you confirm the role for your service account is at least "Service account user" (you could also try giving the service account full "Owner" permissions)?
In the "API Access" page in your Play Console, click "View access" for the service account you're using. Make sure it has access to the app you want. I think we recommend just giving it "Manage orders and subscriptions" permission, but again you could try giving the full "Admin" permissions.
Also double-check that the service account credentials are correct in functions/src/config.ts. Make sure the service account email is the same as the one listed under "API Access". For the private key, copy the ENTIRE string as is from the key file (including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----\n parts of the string. Then deploy your backend if you made any changes
Yes this is confirmed.
I think to simplify things a bit more.
Returns this error:
{
"error": {
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"status": "PERMISSION_DENIED"
}
}
If I understand it correctly I think this is the source of the problems. If this call works then I think the https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/get should work too.
As you can see from the supplied screenshots above however we are pretty sure we have everything linked correctly.
Any ideas?
from pwa-play-billing.
Thanks for double-checking everything. You're right, everything looks great and the service account looks like its linked correctly. The only thing I can think of is that it can sometimes take 24-48 hours for the service account permissions to sync and API calls to start working.
If it's any consolation, when using https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get to test the API, I also see the same errors you do. I'm not entirely sure how that works and how it's retrieving credentials and why it would error, cause I'm not seeing those errors in our actual live sample. All to say, I'm not sure it's an accurate indicator of whether you've got your own code set up correctly.
from pwa-play-billing.
All to say, I'm not sure it's an accurate indicator of whether you've got your own code set up correctly.
Oh really? Ah okay I have been relying on that as an indicator for if things are working. I wanted to reduce variables such as malformed credentials or something by using that API explorer.
Okay ill go back to manually testing using our own backend and putting fake purchases through.
from pwa-play-billing.
WTF.. just tried using our backend and it now works!!
Oh my god! :D
Wow if it really does take that that long for permissions to sync accross and the API exporer from the docs give you permission errors no matter what that is a MASSIVE gotcha and really should be highlighted in bold magenta font everywhere. We just wasted days and earned some more grey hairs over this :(
Thanks for your assistance with this.
from pwa-play-billing.
Related Issues (13)
- Add manage subscription link
- Check for un-acknowledged purchases and acknowledge them HOT 3
- Testing Locally? HOT 3
- Not able to request an origin trial token HOT 1
- "Create new service account" Button does not exist anymore in Play Console HOT 3
- Dependabot HOT 3
- Gt
- Persistent "Payment method https://play.google.com/billing is not supported" HOT 1
- Convert to Vite HOT 1
- Need this downloaded and install
- No support for any development environment HOT 1
- Why don't we have a.ISO version of CHROME OS FLEX .BIN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pwa-play-billing.