How can we force user to update the latest version of app

The old version of my app had some securities flaws that we have fixed with new version. Now I want to force old user to update the latest app version whenever they use app. But the problem is I can’t distinguish between old user and new user.

First I though I could do it by updating the version no in package.json or app.json but when I publish the app with changes it had updated the packges.json in old version of app as well.

So my logic didn’t work there.

I just want to show a popup if user app version is older than latest version but when you do expo publish it has impact in old apk as well.

Any other idea to get the this done?