1

I am implementing that app timeout functionality, If user keeping the application in idle for five minutes, the application will get logged out automatically. This concept I did use the UIApplication sendEvent method.

But, SFSafariviewcontroller does not call the UIApplication sendEvent when the user using the SFSafariviewcontroller. So, app getting logged out even though the application used by the user.

Is there any solution to resolve this issue?

Denis
  • 492
  • 2
  • 15

1 Answers1

0

I don't believe it's possible to detect activity within an SFSafariViewController.

Reference from the documentation: https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller?language=objc

The user's activity and interaction with SFSafariViewController are not visible to your app

Instead if you need this functionality you may want to look at WKWebView: https://developer.apple.com/library/mac/documentation/WebKit/Reference/WKWebView_Ref

If your app lets users view websites from anywhere on the Internet, use the SFSafariViewController class. If your app customizes, interacts with, or controls the display of web content, use the WKWebView class.

So my overall recommendation would be to either use WKWebView, or disable the locking strategy while displaying the SafariViewController

R4N
  • 2,455
  • 1
  • 7
  • 9