Google Maps URL scheme not working on iOS 9

风格不统一 提交于 2019-11-27 09:25:23
Janu Gandhi

In iOS 9, Apple has made a change to the handling of URL schemes. Now you need to add "LSApplicationQueriesSchemes" key in plist and then add URLScheme you want to call.

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

In iOS 9.0, further restrictions were placed on the canOpenURL method -- for this method to work, you will need to add a LSApplicationQueriesSchemes array to your app's info.plist file, and then add items for each URL scheme you will want to query. These schemes as comgooglemaps, comgooglemaps-x-callback, and your own app's custom URL scheme.

I have added following items in my info.plist.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>comgooglemaps-x-callback</string>
</array>

Try with this sample code OpenInGoogleMaps-iOS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!