Giter VIP home page Giter VIP logo

Comments (5)

joycetoh8 avatar joycetoh8 commented on July 21, 2024

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.

mikecann avatar mikecann commented on July 21, 2024

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)?

image

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.

image (7)

image (8)

image (9)

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.

This page: https://developers.google.com/android-publisher/api-ref/rest/v3/inappproducts/list?apix_params=%7B%22packageName%22%3A%22io.battletabs.twa%22%7D

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.

joycetoh8 avatar joycetoh8 commented on July 21, 2024

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.

mikecann avatar mikecann commented on July 21, 2024

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.

mikecann avatar mikecann commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.