Here are some issues I encountered when trying to display Google Maps on an iPhone.
Referring to Google Maps API > For iOS > Maps SDK for iOS, I tried to display Google Maps on the screen, but the screen was completely white and nothing appeared.
The following error message appeared in the console:
|
|
After searching online, I found this site. In my case, the third check revealed that my API key was “invalid”.
The cause of this error is usually some mistake in the API key settings. Please check the following points:
- When generating the API key, it’s better to set the bundle ID of your Xcode project. Google says this parameter is “optional,” but it’s safer to set it.
- If you change your app’s Bundle ID, be sure to regenerate the API key.
- Make sure that “Google Maps SDK for iOS” is enabled in the Google Developers dashboard. By default, it is disabled. (This was the issue in my case)
If I have time, I plan to upload a screenshot of the API key enabled screen as well.