onMessage don't trigger everytime since iOS 18
Bug description:
Since last iOS 18 beta (released 9 september) our app suffer from troubles with react-native-webview. We are using it to login in a webview and go back to app using onMessage, which is not called each times. We tried to reinstall the app to clear caches, which is working some times but not every times, toggle new Safari settings like "Privacy Preserving Ad Management", fixed for some devices but not very ones, ... Tried to upgrade react-native-webview, didn't work either. New iphone 16 is coming and the storm is coming from our clients.
We can't find any similar issue.
To Reproduce:
Launch simulator or device in iOS 18, install react-native-webview, create a new project and try to catch onMessage event from a webview.
Expected behavior:
onMessage event is catched everytime.
Environment:
- OS: MacOS
- OS version: Sonoma 14.6.1 (23G93)
- react-native version: 0.71.11
- react-native-webview version: 12.4.0
Any thoughts on this ?
UPDATE
Okay we found why but not the root cause. It seems for some reasons the webview not passing some headers through pages, not every times, which we are using to follow mobile flow. Temporary workaround is to base our workflow on user agent.
No clues about the cause
@BloodyMonkey I tried setting the userAgent prop on the WebView but the issue persists.
We encountered a similar problem.
Our app fails logging in to an external idp using a WebView on ios18. This is caused by cookies not being persisted in the WebView, resulting in a missing header on our server requests that "breaks" our sticky-session behavior. It might be related to general iOS WebView problems discussed here:
https://forums.developer.apple.com/forums/thread/761938
This is critical, We couldn't come up with any workaround and users fail to login upon upgrading to ios 18 @BloodyMonkey
@NoamaExl this is approximatively the same problem here, we identified this is a WebKit issue too, but unable to find a solution... It seems to happen mainly on old backend stacks, and we decided to hurry up the delivery of our brand new architecture to solve the problem.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically