mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
259 stars 117 forks source link

Why are these warnings popping up? #154

Closed niyazimustafa closed 11 months ago

niyazimustafa commented 12 months ago

2023-07-10 12:01:24.576523+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "iosamap://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 2023-07-10 12:01:24.579686+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "baidumap://" - error: "This app is not allowed to query for scheme baidumap" 2023-07-10 12:01:24.582699+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "waze://" - error: "This app is not allowed to query for scheme waze" 2023-07-10 12:01:24.585582+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "yandexnavi://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 2023-07-10 12:01:24.588324+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "yandexmaps://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 2023-07-10 12:01:24.590741+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "citymapper://" - error: "This app is not allowed to query for scheme citymapper" 2023-07-10 12:01:24.592974+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "mapswithme://" - error: "This app is not allowed to query for scheme mapswithme" 2023-07-10 12:01:24.595880+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "osmandmaps://" - error: "This app is not allowed to query for scheme osmandmaps" 2023-07-10 12:01:24.598256+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "dgis://" - error: "This app is not allowed to query for scheme dgis" 2023-07-10 12:01:24.600441+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "qqmap://" - error: "This app is not allowed to query for scheme qqmap" 2023-07-10 12:01:24.603193+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "here-location://" - error: "This app is not allowed to query for scheme here-location" 2023-07-10 12:01:24.605627+0300 Runner[52566:13715846] -canOpenURL: failed for URL: "tomtomgo://" - error: "This app is not allowed to query for scheme tomtomgo"

mattermoran commented 12 months ago

The only way (afaik) to check if map is installed on iOS is to check if that map can be opened by its url scheme. Because you did not add that url schemes in your info.plist file it’s not able to check that.

niyazimustafa commented 12 months ago
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sms</string>
<string>tel</string>
<string>mailto</string>
<string>whatsapp</string>
<string>comgooglemaps</string>
<string>baidumap</string>
<string>iosamap</string>
<string>waze</string>
<string>yandexmaps</string>
<string>yandexnavi</string>
<string>citymapper</string>
<string>mapswithme</string>
<string>osmandmaps</string>
<string>dgis</string>
<string>qqmap</string>
<string>here-location</string>
<string>tomtomgo</string>
<string>copilot</string>
</array>

Even though it is attached, those warnings appear? How can we lose?

mattermoran commented 12 months ago

I assume this warning will also pop up if these maps are not installed on a device. Is that the case?

niyazimustafa commented 12 months ago

then is this a mistake or not? Will it cause a crash? It would be better if it didn't appear.

mattermoran commented 12 months ago

It shouldn't be causing crashes or anything of sorts it's just a warning. I'm not sure if there's a way to make them not show up I might check some time.

niyazimustafa commented 12 months ago

Thank you. I would be glad if you could review it at the appropriate time. nice package

mattermoran commented 11 months ago

I did some read up and it most likely because you have not declared it correctly in info.plist file. Either way it won't crash the app but worst case maps won't show up (except apple maps)