I'm developing a Flutter app, and I want it to be able to handle location or map links. Specifically, I want my app to appear in the "Open with" options when a user clicks on a map or location link on their Android device and if possible, get the lat and long of the map/location link. However, I'm having trouble getting my app to show up in the list of options.
I've tried adding an intent filter inside the AndroidManifest.xml file, but my app is still not recognized as an option to open these links, is there another step or a different approach that I should do?
This is how I expect the app to appear
And here's the relevant part of my AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="www.google.com"
android:pathPrefix="/maps" />
</intent-filter>
If you want to open Google Maps links in app, adjust it as follows.
Make sure it is inside the activity tags intent-filter
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="maps.google.com"
android:pathPrefix="/maps" />
</intent-filter>
With this configuration, your app will handle URLs with the "http" scheme, the host "maps.google.com," and a path that starts with "/maps." For example, it will match URLs like:
http://maps.google.com/maps/place/...