title: Recognize return url inside Chrome Custom Tabs and SFSafariViewController in Flutter
body: <p>I have a project where customers are redirected to complete a payment request on their bank's url opened in in-app browser (<code>Chrome Custom Tabs</code> on Android or <code>SFSafariViewController</code> on iOS). App is written in <code>Flutter</code> and we uses <a href="https://github.com/pichillilorenzo/flutter_inappwebview" rel="noreferrer">flutter_inappwebview</a> for that purpose. There are 2 paths when completing a pruchase: </p>
  
  <ul>
  <li><p>Bank app exists, and the project can open that bank app and complete the payment there. Successful return is implemented using app links for Android and universal links for iOS. This flow works perfectly.</p></li>
  <li><p>There is no bank app and user is presented with <code>Chrome Custom Tabs</code> or <code>SFSafariViewController</code>, where he needs to complete the entire payment flow consisting of few screens (steps to enter bank info, then verifying pin or sms, and last is success screen). Last screen is the one with "redirect url" found in the url opened (one of the parameters of the url, not the entire url). </p></li>
  </ul>
  
  <p>When using WebView (InAppBrowser class in that plugin), there is a callback <code>onLoadStop</code> where I can recognize redirect and monitor if this "return url" is found when redirecting on last screen of payment. In case of <code>Chrome Custom Tabs</code> or <code>SFSafariViewController</code> such callback doesn't exist and I am not sure how I can recognize presence of this "reutrn url" and act when I see it to close the in-app browser and perform action of displaying personalized user message "You have completed your purchase successfully". Any ideas how this can work? </p>
  
  <p>Even if you don't know flutter any help on how this is achieved in native code will help to know more if this is even possible and how do native apps handle this scenario.</p>