1

I was trying to build a feature announcement where I can tell the users that there is a new feature available on my flutter app.

The problem is that I don’t want to show this if someone just downloaded the app, since they are new users anyway, I just want to show that to users that were using the app before.

Is there a way to know previous versions of the app that were installed or if the app was updated vs just downloaded?

Leonardo de Jesus
  • 387
  • 1
  • 3
  • 15

1 Answers1

0

First of All there is package to find your app current version number and build number, I have used this personally with the backend to show some new features to our new users.

  1. Add this to your package's pubspec.yaml file:

    package_info: ^0.4.0+16

  2. Now import the statement into your dart file

    import 'package:package_info/package_info.dart';

  3. And use this if your method is marked as async:

PackageInfo packageInfo = await PackageInfo.fromPlatform();

String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;

Now, What you have to do is that send the current version number in your API, And have a Current Version Value stored in backend, To check for the Versions you are sending in the API's and Compare them to show new Features,

Like Say If I am old User, So My APP Version number is 1 and API's is sending 1 in the backend too.

But If I am new User then, My APP version is number greater than 1 and API's is sending version number greater than 1, And I can see the update in the app if My Version number is greater than 1 as a new User.

Click Here For More Reference to use the Package Sorry For bad English

Mukul
  • 1,020
  • 6
  • 12