I want to direct open to telegram channel using url_luncher from my flutter app.
currently, I can open the telegram app but it does not direct to the channel.
Is there any configure would need to achieve this?
GestureDetector(
onTap: () async {
var url = Uri.parse("tg://t.me/channel_name");
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
child: ListTile(
visualDensity: const VisualDensity(vertical: -4),
minLeadingWidth: leadingTxtSpace,
leading: const CircleAvatar(
radius: 15,
backgroundColor: Colors.blueAccent,
child: Icon(Icons.telegram_outlined, color: Colors.white),
),
title: Text(
"Telegram",
style: Theme.of(context).textTheme.bodySmall,
),
),
),
3
Answers
In my case I used this link, try that too .
https://t.me/user_name
It work in my case..
You can adapt the example yourself
In older version its working fine
After upgrading SDK & Packages facing same issue. app opened but not navigate to specific chatting screen so i found solution for whatsapp & telegram app.
add few things inside
<queries>
in AndroidManifest.xmlin launchURL you need to pass
mode
parameter explicitly with value:LaunchMode.externalApplication
like this:Used URL in my app