HDD
HDD

Reputation: 260

Unable to launch google map link in flutter

Using the link got from google Maps API -> https://maps.google.com/?cid=10698500154823482329 is not working/opening in the app. But when I try to open the same place URL(but it's a website link) https://g.page/jessidrivingschool?share is working fine when using the launch url_launcher library in flutter.

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Could not launch https://maps.google.com/?cid=10698500154823482329

Can you please help with this scenario?

Upvotes: 1

Views: 1304

Answers (1)

Michael Jones
Michael Jones

Reputation: 186

It may be caused by the update to how package visibility is handled in Android 11. You now need to list the third party apps that you interact with. See here for more info https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9

If this is the case, then it can be fixed by adding this to your manifest

<queries>
      <package android:name="com.google.android.apps.maps" />
      <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:mimeType="text/plain" />
      </intent>
  </queries>

Upvotes: 2

Related Questions