Code below works fine but expected scenario is when app is active and running in foreground, it suppose too check updated and show dialog, but it only checks when app is res