Start a new topic

iOS JavaSript SDK v8.9+ Not Resuming JS Properly

Hi there,


We are currently using the iOS JS SDK version 8.10.0. We have tested this issue on iPhone 7 running iOS 13.3.1. 


After a lot of sleuthing I have narrowed this issue down and I'm hoping to get some insight from the Wikitude team about whether you're aware of this issue and if you have a fix for it. We are using the cloud recognition portion of the SDK to overlay video and image drawables on image tragets. It seems that whenever UIWebView was swapped out in favour of WKWebView in SDK version 8.9, any asynchronous or background portions of the JavaScript that were executing before an app interruption are not properly resumed whenever the interruption ends.


For example, on our app we noticed this issue because when the app is scanning and the user navigates away from it, then comes back, on SDK v8.7 it would resume the scanning process as expected, but on 8.9+ it does not. It just stops. We also noticed because our beta release on TestFlight was not executing the full startup JavaScript portion properly because it's interrupted with the "What to Test" screen once the permissions are given. This normally wouldn't be an issue, but with the newer SDK version the JavaScript stops executing on interruption and then doesn't resume where it left off when the interruption is over. The ArchitectView is being stopped and restarted as expected and as outlined in the sample app, which we can see in our logs, it's just the JavaScript portion that isn't restarted properly by this trigger like it was before 8.9.


Thanks for any help!

1 Comment

Hi Matthew,


I have been able to reproduce this issue on our side as well. Unfortunately, it seems to be part of the way WKWebView behaves at the moment. We will be considering a way to handle this particular situation in the future.


For the time being, I would suggest handling this from the JavaScript code. Maybe keeping track of the still unresolved promises in an array, and creating a function that processes them. Then you could call this function from the native side when your main controller becomes available again, using callJavaScript in the start call of WTArchitectView.


Sorry for the inconvenience, let us know if you have any more trouble.



- Damian

Login or Signup to post a comment