Update text on ionic platform resume

Hello,

i’m using ionic to develop an app, in the app i show a message to notify the user to enable location (if the user denied the permission). I want to update this message when the user enables the location and switches back to the app.

listing.page.ts file

ngOnInit(){
   this.platform.resume.subscribe((e) => {
      this.diagnostic
      .isLocationAuthorized()
      .then((isEnabled) => {
       this.gotLocation = isEnabled;
      })
      .catch((err) => {
        console.log(err);
      });
    });
}

The message shows/hides if you close then run the app, however if you run the app then check the app info where you can allow/deny location then switch back to the app the message will not get updated unless i click on a tab or go to another page

I want to update the message as soon as it switches back to the app.