'Unable to launch google meet via link through flutter application
I am trying to build an application where users can join google meet just with one click(I know it is easier to send a meet link via Whatsapp but I want everything in one place). I have used the url_launcher package since google meet generates a URL for every meeting. Every other URL works fine except for the google meet link. Whenever I pass the google meet URL as the parameter to the parse function, it redirects me to a "web page not available" in the emulator(even on a real device).
How do I make the user redirect to that particular meeting and join on the meet app?
final Uri url = Uri.parse("https://meet.google.com/rxf-uxca-jpx");
void _launchUrl() async {
if (!await launchUrl(url)) throw 'Could not launch $url';
}
ElevatedButton(
child: const Text(
'Click here to join',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
onPressed: _launchUrl,
),
I even made these changes in my AndroidManifest.xml file as given in the docs, I don't know if this is required or not.
<queries>
<!-- If your app opens https URLs -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
Solution 1:[1]
Try below code, Its working on my machine, refer my answer here for same.
Your googleMeet function with URL:
googleMeet() async {
const url = 'https://meet.google.com/rxf-uxca-jpx';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Your Widget:
ElevatedButton(
child: Text(
'Click here to join',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
onPressed: () => googleMeet(),
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ravindra S. Patil |
