6

I am trying to load ApplePay popup on WKWebView. I did my initial leg work by implementing it but it does not load up.

Is there something extra I need to implement to make it work ? There is no proper documentation on apple regarding apple pay either.

lifemoveson
  • 1,621
  • 7
  • 25
  • 54

3 Answers3

3

I think you need to use SFSafariViewController.

iOS 10. Apple Pay JavaScript is supported on all iOS devices with a Secure Element. It is supported both in Safari and in SFSafariViewControllerobjects.

Craig Yu
  • 39
  • 3
3

Apple Pay is only supported in SFSafariViewController, and not in UIWebView nor WKWebview.

Vandit Mehta
  • 2,494
  • 21
  • 37
2

Seems that there might be solution: https://webkit.org/blog/9674/new-webkit-features-in-safari-13/

Apple Pay in WKWebView In iOS 13, webpages loaded in WKWebView can now accept Apple Pay. In order to protect the security of Apple Pay transactions in WKWebView, Apple Pay cannot be used alongside of script injection APIs such as WKUserScript or evaluateJavaScript(_:completionHandler:).

If these APIs are invoked before a webpage uses Apple Pay, Apple Pay will be disabled. If a webpage uses Apple Pay before evaluateJavaScript(_:completionHandler:) is invoked, the completion handler will be called with a non-nil NSError. These restrictions are reset every time the top frame is navigated.

petr.sigut
  • 61
  • 4