Reputation: 1538
I want to open Viber app (Android / Windows) from flutter web application. I tried using url_launcher
but it does not work.
The URL to open Viber chat is viber://chat?number=xxx
. How can I call this from flutter web app?
Upvotes: 0
Views: 2450
Reputation: 1800
Searching for the same solution but only for a mobile app, Google gives me only this question. So, I decided to write the research results here. Maybe it will come in handy.
For a mobile app, you can use url_launcher
launch('viber://chat?number=$phoneNumber');
If you want to open the conversation with a predefined text, you can write like this:
launch('viber://chat/?number=$phoneNumber&draft=$yourMessage');
Please note, if Viber is not installed on your device, the launch
method throws an error.
Upvotes: 0
Reputation: 1538
Found a solution. I used html
package
import 'dart:html' as html;
After that
html.window.open('viber://chat?number=xxx', '');
Upvotes: 3