getInstalledStatus method

Future<bool> getInstalledStatus({
  1. required AppsModel data,
})

Implementation

Future<bool> getInstalledStatus({required AppsModel data}) async {
  if (Platform.isIOS) {
    String scheme = data.ios.scheme;
    return await canLaunchUrl(Uri.parse(scheme));
  }
  if (Platform.isAndroid) {
    Uri playstoreURL = Uri.dataFromString(data.android.store);
    String id = playstoreURL.queryParameters['id']!;
    final app = await DeviceApps.getApp(id);
    return app != null;
  }
  return false;
}