Implementing Okta Singin on Ionic App

Dear All,
I’m developing an Ionic application and using Okta for user authentication. Initially I used Okta-signin-widget and it was working fine, when I was testing app on browser. After I deployed app to mobile phone, widget is started giving problems, as it was not able to find redirectUri on phone (window.location.origin). Then I took help from the following link. This is working fine, issue is with automatically refreshing tokens. In augular-odic2-oauth, “setupAutomaticSilentRefresh” method is available, but this uses “postMessage”, and i dont know how to handle it in cordova in app browser.
Could you please guide me how to properly implement Okta signin in an Ionic application and
also auto refresh tokens.


Here’s a demo for Ionic 4 that might help.