Search code examples
iossfsafariviewcontrolleradyen

SFSafariViewController loses state when returning to app


My app has a web-based online payment flow — using Adyen Hosted Payment Page (HPP) — in SFSafariViewController (as recommended by Adyen). When a payment flow happens entirely inside Safari, this works very well.

But some banks use their native iOS app for authorizing a web payment (typically by entering a PIN code there after entering one's user ID into the web flow). When returning to my app, the Safari view controller often reloads its contents, resetting the entire payment flow before the payment has been completed. (Same thing often happens also by simply visiting any other app — guess it has something to do with memory consumption?)

Is there any way to force the Safari view controller to retain its current state, no matter what?


Solution

  • I'm finding the same behavior in my app. In our case we are not using Adyen. But the behavior is the same.

    Each time the app returns to the foreground after a while it loses its status and reloads to the original state.

    I did not find any way to avoid this behavior. Is there any way to force the SFSafariViewController to keep its state?

    UPDATE: I have found this behavior is only happening in iOS 10.0.1