0

I'm trying to integrate PayU payment services in my app. All is done in WKWebview. The user hits the payment button, web view pops up and in the web view the payU service is loaded. All works fine.

The problem appears when the user gets notification from the bank at the end of the navigation. If he clicks on notification and accepts the payment in his bank (clicking notification means he is navigated to his bank app), my app is suspended and lo longer executing JS methods. Because of that, if the user goes back to my app, he still sees the last screen from the web view saying 'confirm the payment in the bank', but it should now show accepted or failed payment. My question is: how to make JS methods run in background and not be suspended? Is there a way for that? Anyone has ideas?

aleksy.t
  • 267
  • 2
  • 18

1 Answers1

0

As I know, you can't run JS in background. I don't know how PayU works, but maybe you can do some check in applicationDidBecomeActive (after the app came back from the background) for the result of the transaction.

arunna
  • 1
  • 4