10

I have a requirement where the admin of the application creates a user's account.

Post creation of the user's account an email will be sent to the user. In this email, the user is provided with a hyperlink. When he/she clicks this link then following actions are taken-

  1. Identify the requested application is installed on the device or not.
  2. If installed then redirect to the password setting screen of the application.
  3. If not installed then redirect the user to the play store/App Store to download the requested application. when download completed redirect to password setting screen.

Thank you.

Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
Dhanraj Verma
  • 647
  • 1
  • 9
  • 14

2 Answers2

6

For point 1. you can use the device_apps plugin, to check wheater the app is installed or not (not supported on iOS though!): https://pub.dev/packages/device_apps

Point 2. can be implemented using the uni_links package:
https://pub.dev/packages/uni_links

But there seems to be a problem with opening the apple app store on iOS when the app is not installed.
This post might help:
How to implement deep linking in flutter, with redirect to app store?

Hope these links help and good luck

DoobieAsDave
  • 1,034
  • 3
  • 12
  • 22
2

You can also use the flutter_appavailibilty plugin to check if an app is installed. From the pub.dev page:

if (Platform.isAndroid) {

  _installedApps = await AppAvailability.getInstalledApps();

  print(await AppAvailability.checkAvailability("com.android.chrome"));
  // Returns: Map<String, String>{app_name: Chrome, package_name: com.android.chrome, versionCode: null, version_name: 55.0.2883.91}

  print(await AppAvailability.isAppEnabled("com.android.chrome"));
  // Returns: true

}

Like the other package though, this one also doesn't support iOS at the moment.

Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61