How to open Viber app in Flutter web app? - flutter

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?

Found a solution. I used html package
import 'dart:html' as html;
After that
html.window.open('viber://chat?number=xxx', '');

You can try this package Flutter AppAvailability Plugin

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.

Related

Is it possible to create a custom share sheet in Flutter?

I want to build this custom share sheet shown in the screenshot depending on the apps that are on the mobile, could anyone tell me if it's possible? screenshot
i am currently using flutter's share_plus package, but the share method summons the platform's share sheet, is it possible to customize my own share sheet and use it for both platforms android and ios?
Using the Flutter Availability package you can customize this by styling BottomSheet from scratch. Still, this package is only for Android devices. Unfortunately, iOS does not provide any API to get the installed APPs information.
I guess You'll have to work with a modalBottomSheet and https://pub.dev/packages/url_launcher
You can check if an application is installed, but this would work only for android Is there any way to identify that a particular application is installed in my android/ios device through flutter and dart?

Is there any API for video conferencing for Flutter Web?

I am currently working on Flutter web and want to build Google meet like feature in the web app. I found some like Jitsi, 100ms and VideoSDK, but they don't support FLutter web.
I am not familiar with it. But i know Agora is supporting flutter. But i don't know if it will work with flutter web.
https://docs.agora.io/en/Video/landing-page?platform=Flutter
Edit:
The SDK package says it supports web
https://pub.dev/packages/agora_rtc_engine/versions/5.2.0

How to check if flutter web app has been installed on the device?

I am using flutter web to make a web app, and I want to know whether the user has actually installed the web app or whether the web app is being run on a browser..
I want to know this so I can allow special features to users that have installed the web app in their devices. (e.g allow local_notifications which is not possible for flutter running on a browser)
Use JavaScript. Insert this HTML code to your index.html
<script>
function isPwaInstalled() {
return window.matchMedia('(display-mode: standalone)').matches;
}
</script>
Then in your dart file
import 'dart:js' as js;
bool isPwaInstalled() => js.context.callMethod("isPwaInstalled");
When your PWA app is installed to desktop this method will return true.
Note that the dart:js lib is available only on Flutter web, if you import it on other platforms such as iOS or Android, the compiler will complains about it. To avoid this, see Conditional Import or this blog
Adding a Safari Shortcut from a WebApp to HomeScreen is nothing like installing it. It just opens your WebApp in Safari browser
You won't know the difference with normal viewing of your WebApp
You can check the device with platform_detect 2.0.0 package thought but that's about it
Link to package https://pub.dev/packages/platform_detect

barcode_scan not running on Flutter Web app

I have a fully functional app. I use barcode_scan in the app, but when called on the web app, it does not launch. Any help?
barcode_scan doesn't claim support for flutter web as you can see on the package site. As can be seen in the description, this package simply provides a wrapper for existing barcode scanning packages for both iOS and android.

Flutter: Launch my other application from flutter application and get some data back

Using flutter to launch other applications on both the platform (Android/iOS). I know we can use url_laucher to launch applications like Gmail or Google map.
Can it also be used for launching my own application?
If "YES", is it possible to get some data back from my other application to flutter application?
If "NO" then is there any other way to do this. My goal is to get the data (like a simple string) back from my other app.
NOTE: Constraint is that I have to use flutter Widgets or packages and not touch the native directories.
Yes, you can use url_launcher to launch your own application provided your application has appropriate url schemes defined.
No, you cannot get back any data by launching an application with url_launcher
Is there a way to achieve this only using flutter widgets and existing plugins?
Yes, only on android. There seems to be a flutter_share plugin that allows you to share data to other apps and receive data shared by other apps.
Hope that helps!