umts / pvta-multiplatform

Transit realtime app for mobile devices
Other
6 stars 5 forks source link

Route Map and API key #468

Closed mboneil10 closed 5 years ago

mboneil10 commented 5 years ago

Route map looks like this for all routes (grayed out with "For development purposes only").

screen shot 2018-09-13 at 1 45 08 pm

Google prompts with:

screen shot 2018-09-13 at 1 46 47 pm

@werebus researched it and found it has to do with our API key. Either we're using it too much, didn’t pay enough, or something else.

sherson commented 5 years ago

Came here to create an issue for this... you beat me to it (noticed it while helping a passenger on 39 today).

If you're able to determine if it's just a billing issue, we can contact PVTA.

sherson commented 5 years ago

@Anbranin, can you assist @mboneil10 with this? You were probably the last person to deploy this app.

Anbranin commented 5 years ago

@sherson not sure what that has to do with anything, and @mboneil10 was there with me, but of course I'm willing to assist. We need credentials to log into whatever accounts on iTunes and Google Play there are. I don't have them.

mboneil10 commented 5 years ago

FWIW, the username in Sept 1, 2017 meeting notes is pvtadeveloper@gmail.com. I didn't have LastPass at the time, so I didn't save it or write it down anywhere (hooray). Worst case scenario, could we reset it?

mboneil10 commented 5 years ago

I've got it, no worries.

sherson commented 5 years ago

To clarify, this is not an issue with the mobile apps (iTunes, Google Play). The issue is with the Google maps API and billing, which changed in May:

In addition, this change will require you to enable billing and associate it with all of your Google Maps Platform projects.

We weren’t sure what account was used for that (looked a couple days ago and didn’t find it).

We have the credentials for logging in to Apple's dev site with pvtadeveloper@gmail.com but I think that account may have been setup by PVTA later, in which case it wouldn't help us for this. But just to confirm, @mboneil10 are you able to login to the Google API console with it?

I attempted to email @akaplo in case his account was used for this (his umass email account is no longer active so it bounced). We may need to generate a new API key.

I emailed PVTA about getting a credit card for billing information.

@mboneil10 and @Anbranin: Can you figure out how to check the site's usage? I expect PVTA will want to know how close we are to actually having to pay anything.

Also for reference: https://cloud.google.com/maps-platform/user-guide/

sherson commented 5 years ago

Also, for the record, this all seemed somewhat vaguely familiar... it's because @akaplo contacted me months ago about impending Google maps API billing changes, but that got lost in the shuffle. So this is my fault, not his.

akaplo commented 5 years ago

@sherson sorry I wasn't more aggressive on this when I messaged you; I really didn't think we'd hit the upper limit. I do still have federated access to the API console through my personal Google account, so if you need a hand taking care of it let me know! akaplowitz@alum.cs.umass.edu is me now if you ever need me.

akaplo commented 5 years ago

FYI, the past 24 hours have yielded 3035 total Maps API requests

image

mboneil10 commented 5 years ago

Should I find PVTrAck already on Google Cloud?

mboneil10 commented 5 years ago

Because it isn't with pvtadeveloper@gmail.com

sherson commented 5 years ago

PVTA said they're OK with giving us a credit card. I'm just waiting for the money person to have a chance to do that.

@akaplo and @mboneil10 can you coordinate getting console access to pvtadeveloper@gmail.com?

For reference, the current projects are:

Project: pvtrack - web (975704128035) Project: pvtrack - developer (152292633987)

Also, please confirm which SKU we're using from https://cloud.google.com/maps-platform/pricing/sheet/

sherson commented 5 years ago

Billing is all set. @mboneil10 is working on generating a new API key (for pvtadeveloper@gmail.com).

mboneil10 commented 5 years ago

Alright, generated a new API key and added it to the MapService. Things to note:

mboneil10 commented 5 years ago

Well, now I know the new API key is definitely working because it restricted me from using it in development. Kind of humorous. I'll change that now, so the API is also restricted to http://localhost:8100/*

werebus commented 5 years ago

Two things:

  1. You shouldn't use the same key in dev as production
  2. I'm pretty sure that restricting to a specific web page won't work with the mobile apps (since they aren't on our web server). It used to be that there was a way to restrict to a given app bundle name, I think?
mboneil10 commented 5 years ago
  1. Okay, I'm not sure how to use different keys for dev versus production. Do I need to generate another key? I'll figure it out if no one knows.

  2. Got it. I'll look into that. Thanks @werebus

werebus commented 5 years ago

Broken again for some reason?

sherson commented 5 years ago

@dfaulken do you have time to look into this?

mboneil10 commented 5 years ago

I could look into it if @dfaulken doesn't have time. Let me know, I'd be interested in seeing what's going on.

dfaulken commented 5 years ago

Will look into tomorrow.

dfaulken commented 5 years ago

Tried looking into this today, I don't have the credentials to look at the key in the Google developer console.

mboneil10 commented 5 years ago

Dave, would you like me to send those to you via LastPass? Not sure if the credentials have changed.

werebus commented 5 years ago

Probably related, in the JS console:

You have exceeded your request quota for this API. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors
dfaulken commented 5 years ago

The quotas themselves were fine, but our entire Google Cloud Platform account had finished its free trial. At @sherson's request, I upgraded the account, and things appear normal now.

dfaulken commented 5 years ago

@sherson I'll leave it to you for official closeout once we do whatever we need to to confirm that things look good now.

sherson commented 5 years ago

Yep, looks good. Thanks.