Redirect to Ionic App when using oauth2

Hi All
In my app I am using oauth2 but have an issue with redirecting to ionic app.
1.Opening Ionic app and on click of button external link is opening for signup
2.Once signup done that webpage is posting code id onto app
3.I mention redirect url as localhost but website not redirect to app and not posting data
4.I tried with https with ip but not worked.
5.Tried ssl with ionic cordova run android but not worked

Testing on Emulator and Mobile.
getting error ERR_NAME_NOT_RESOLVED.

If any one have any workflow please let me know.