Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google map not showing in iPhone - Empty page with Google text in bottom of the screen #9

Open
TeamBrahma opened this issue May 3, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@TeamBrahma
Copy link

TeamBrahma commented May 3, 2024

Bug Report

Google map not showing in iPhone - Empty page with Google text in bottom of the screen

Plugin(s)

"@capacitor/core": "6.0.0",
"@capacitor/google-maps": "^5.4.1",
"@capacitor/ios": "^6.0.0"

Capacitor Version

@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

Platform(s)

Currently i tried with Iphone 13

Current Behavior

Empty page with Google text in bottom of the screen

Expected Behavior

I want to display google map

Code Reproduction

Other Technical Details

Additional Context

I tried with web and Android it's working fine

@ionitron-bot ionitron-bot bot added the triage label May 3, 2024
@TeamBrahma TeamBrahma changed the title Google map not showing in iOS - Empty page with Google text in bottom of the screen Google map not showing in iPhone - Empty page with Google text in bottom of the screen May 3, 2024
@IT-MikeS IT-MikeS transferred this issue from ionic-team/capacitor-plugins May 13, 2024
@IT-MikeS IT-MikeS added the bug Something isn't working label May 13, 2024
@ionitron-bot ionitron-bot bot removed the triage label May 13, 2024
@divyesh-savaliya
Copy link

Facing the same issue.
Is there any update on this?

@viernullvier
Copy link

I was facing the same issue and found that it's a common failure mode if the API key is invalid. Generating a new API key that is limited to iOS devices and allow-listed for the correct app bundle identifier fixed the issue.

Note that the same issue appears on Android if an unauthorised API key is set up in AndroidManifest.xml. I haven't tested it for the web platform, but since API keys dedicated to Android / iOS / Web are mutually exclusive and unrestricted API keys are actively discouraged by Google, it is quite likely that an API key that works on the web platform will not work for iOS and vice versa.

@co-dax
Copy link

co-dax commented Jul 25, 2024

Having the same issue on iOS. It is displaying the markers and the "Google" label in left bottom angle but no actual maps content is displayed.
On android is working fine on transparent background(s).

@divyesh-savaliya
Copy link

divyesh-savaliya commented Jul 25, 2024

I am able to fix this by passing iOS key in apiKey parameter, I was using javascript key earlier which was causing this issue.
Usign iOS key instead of javascript works for me.

const newMap = await GoogleMap.create({
  element: mapRef, // reference to the capacitor-google-map element
  apiKey: apiKey, // <====== google map iOS key
  config: {
    center: {
      // The initial position to be rendered by the map
      lat: 33.6,
      lng: -117.9,
    },
    zoom: 8, // The initial zoom level to be rendered by the map
  },
});

@co-dax
Copy link

co-dax commented Jul 25, 2024

@divyesh-savaliya what versio fo the plugin are you using?
As for iOS googl maps key there is only option to limit access to only specific iOS bundle ids when using iOS restriction. Is that what you refer to by "iOS key"?

image

@divyesh-savaliya
Copy link

divyesh-savaliya commented Jul 25, 2024

As in filter Maps SDK for iOS is not shown, you need to enable it on google console.
You can follow this instructions.

@co-dax
Copy link

co-dax commented Jul 25, 2024

@divyesh-savaliya that's it, thanks! I had not enabled Map SDK for iOS. Now it works.
By the way it works with a completely unrestricted key, it was enough to just enable iOS sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants