Google Maps URL scheme not working on iOS 9

后端 未结 2 377
你的背包
你的背包 2020-12-06 16:37

The following URL scheme was working on previous version but doesn\'t work anymore on iOS 9:

comgooglemaps://?q=Google+Japan,+Minato,+Tokyo,+Japan¢er         


        
相关标签:
2条回答
  • 2020-12-06 16:58

    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> 
    
    0 讨论(0)
  • 2020-12-06 17:24

    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.

    0 讨论(0)
提交回复
热议问题