googlemaps / ios-places-sdk

Apache License 2.0
9 stars 2 forks source link

[Places API (New)] "isOpenWithPlace:callback:" is not working as documented #17

Open twaddington opened 1 month ago

twaddington commented 1 month ago

The method isOpenWithPlace:callback: does not appear to work as documented.

When calling this method with an API key restricted to only "Places API (New)", an error is thrown for every call, indicating a Place Details request is being attempted.

The operation couldn’t be completed. Operation failed due to an invalid (malformed or missing) API key. See the developer's guide (https://developers.google.com/places/ios-sdk/start) for information on creating and using an API key.

This is not expected since the place object has the required fields present.

result=GMSPlaceOpenStatus(rawValue: 0), hasOpeningHours=true, hasCurrentOpeningHours=true, businessStatus=GMSPlacesBusinessStatus(rawValue: 1), utcOffsetMinutes=Optional(-420)

Updating the API key restrictions to include the "Places API" eliminates the error but "Places Details" (SKU: FC5C-DF28-543F) requests are seen in our billing report.

This seems like a bug in the SDK. Additionally, this method should have an option to immediately throw an error if the Place fields aren't present, otherwise this call may result in unexpected charges.

Using the deprecated isOpen method on GMSPlace appears to work as intended.

Environment

twaddington commented 1 month ago

Also reported here: https://issuetracker.google.com/issues/359628055