9

Getting this error - "This app is not allowed to query for scheme comgooglemaps.Even though i have added "comgooglemaps" in LSApplicationQuery.

Even i have also added "googlechromes" and google map is also installed on iPhone. Still i am getting this error everytime. Please help me with it.

Complete Error -

-canOpenURL: failed for URL: "comgooglemaps://" - error: "This app is not allowed to query for scheme comgooglemaps" 2018-08-24 12:31:58.882862+0530 BrotherToBrother[934:253238] Can't use comgooglemaps://

Nishita
  • 91
  • 1
  • 2
  • Possible duplicate of [How would I be able to open google maps when I press a button in my app?](https://stackoverflow.com/questions/32772727/how-would-i-be-able-to-open-google-maps-when-i-press-a-button-in-my-app) – Enea Dume Aug 24 '18 at 09:40

3 Answers3

26

You need add comgooglemaps in your plist of project info

enter image description here

Phineas Huang
  • 813
  • 7
  • 19
4

The regular adding scheme to info.plist doesn't work I don't know why. But finally I found a way by using info.plist source code

1- Right click on info.plist

2- Open source code

3- Copy the following code:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
</array>

After changing a way it works for me. hopefully answer be useful for you

2

For those who still having this problem like me, I actually faced the same problem and the reason was I only add comgooglemaps to plist.

We have to add both comgooglemaps and googlechromes to the plist file like below.

enter image description here