App Force Update

Overview

Show Update App Pop Up to end users if there exists a new release in Google play store or IOS App Store

MDMS Configuration

Add the below file in common-masters MDMS,

https://github.com/misdwss/mdms-mgramseva/blob/UAT/data/pb/common-masters/AppVersion.json

Whenever a new release is deployed to play store or app store, update the version inside the above file.

Note : Version deployed in Play Store and App Store should match the version in https://github.com/misdwss/mdms-mgramseva/blob/UAT/data/pb/common-masters/AppVersion.json

{ "tenantId": "pb",

"moduleName": "common-masters",

"AppVersion": [

{

"latestAppVersion": "1.2.0",

"packageName": "com.dwss.mgramseva"

} ]

}

Logic Implemented for Version check :

commonProvider.getAppVersionDetails(); MDMS call is made , every time a user opens the app.

In Landing Page widget, afterViewBuild();

await commonProvider.getAppVersionDetails(); CommonMethods() .checkVersion(context, commonProvider.appVersion!.latestAppVersion);

CommonMethods() .checkVersion(context, commonProvider.appVersion!.latestAppVersion);

returns a pop up, validating if package version matches the version in MDMS.

 

Primary files:

https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/main.dart

https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/utils/common_methods.dart