mattermoran / map_launcher

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

Add support for CoPilot #150

Closed tjeffree closed 1 year ago

tjeffree commented 1 year ago

This pull request adds support for CoPilot.

https://play.google.com/store/apps/details?id=com.alk.copilot.mapviewer

https://apps.apple.com/us/app/copilot-gps-navigation/id504677517

Tested on Android and iOS.

mattermoran commented 1 year ago

Looks good! I'll do a quick test and release if all's well :)

tjeffree commented 1 year ago

@mattermoran I've got a second branch on the go to update this plugin to maybe better support more recent changes in the visibility of packages on Android.

In short it avoids the use of packageManager.getInstalledApplications() and instead relies on testing intents. The developer would also need to add the list of possible packages to their <queries> section in the AndroidManifest.xml. But my hope is that this will more easily pass Googles review process.

If you get a chance, could you take a look here and see what you think? https://github.com/mattermoran/map_launcher/compare/master...tjeffree:map_launcher:detection-refactor

mattermoran commented 1 year ago

Interesting. So using the packageManager is ok long as .getInstalledApplications not being called? In that case I guess it might be better to go with your solution but would need to make sure it works on different versions of android. Regarding <queries> thing would also need to be defined in the app's manifest given that it's already in the plugin's?

tjeffree commented 1 year ago

So using the packageManager is ok long as .getInstalledApplications not being called?

From what I could find the safest method was to simply test the intents. It's mentioned in a various places but isn't exactly explicit:

https://developer.android.com/training/package-visibility/use-cases https://developer.android.com/guide/components/intents-common

Regarding thing would also need to be defined in the app's manifest given that it's already in the plugin's?

That's just my gap in knowledge of Flutter plugins. So that's inherited by the app that's using the plugin, that makes sense.

mattermoran commented 1 year ago

AFAIK manifests from different plugins and the app's get merged into one so as long as queries defined in the plugin it should be alright. We could definitely give this a go and publish as a pre-release to see if there's any issues.

tjeffree commented 1 year ago

Sure, will do. Thanks.

mattermoran commented 8 months ago

Released in v3