Home > other >  ionic on IOS Google Maps JavaScript API error: RefererNotAllowedMapError
ionic on IOS Google Maps JavaScript API error: RefererNotAllowedMapError

Time:04-11

hay, im develop an app on ionic platform , im trying to get some information from google api to show on map In ionic 4.7.1 on IOS I try to access Google Maps services and get the following error: Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: ionic://my-domain/home/appointments-new/appointments-search-fields

The request with an ionic preffix instead of https preffix and causes error of CORS.

CodePudding user response:

The RefererNotAllowedMapError means that the current URL loading the Maps JavaScript API has not been added to the list of allowed referrers, as per Error Messages documentation (https://developers.google.com/maps/documentation/javascript/error-messages).

As per the error message you have shared, you can add ionic://my-domain/home/appointments-new/appointments-search-fields to your list of website restrictions for the API key you're using. The steps on how to do this can be found here:

  • Related