Unable to navigate back to iOS application after successfull login from instagram

I have integrated Instagram in my application for login purpose. I am able to login successfully but unable to navigate back to my app from Instagram web view in first attempt. Once user is logged in and I am authorising it again then it is working as expected.

As per documentations, https://www.instagram.com/developer/authentication/,

we should get access token after user is logged in successfully, but in the following method

func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool { }

I am getting request url as "https://staticxx.facebook.com/connect/xd_arbiter/r/lY4eZXm_YWu.js?version=42#channel=f273c5b460613c6&origin=https%3A%2F%2Fwww.instagram.com"

which actually should have gave me access token.

Could some one help me to fix identify the issue?