Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Open a Apple map on flutter gives invalid URL scheme

In flutter code to open maps is like this. It is working on google but not launching apple map url. Might be small mistake or missing something

                       String addrs = '';
                       addrs = '###';
                       String googleUrl =
                           'comgooglemaps://?q=${Uri.encodeComponent(addrs)}&center=lat,lng';
                       String appleUrl =
                           'https://maps.apple.com/?q=${addrs}&sll=lat,lng';
                       if (await canLaunch("comgooglemaps://")) {
                         print('launching com googleUrl');
                         await launch(googleUrl);
                       } else if (await canLaunch(appleUrl)) {
                         print('launching apple url');
                         await launch(appleUrl);
                       } else {
                         print('Could not launch url');
                       }```

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Please encode the URL for apple maps as you have done for google maps.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading