0

I am a .NET developer and am troubleshooting an aspect of a website that we host inside an iOS native app and am trying to use window.alert('') calls from within javascript to debug an unrelated issue. I'm currently on iOS 13.x and the app was built using Xamarin.

As I trigger items in the website I'm not seeing any of the window.alert() messages appear while they do work as expected when browsing the website directly in Safari on iOS.

I'm starting to wonder if its because by default window.alert() prompts will not show when the website is hosted within a "webview" of the iOS native app? Apologies I don't know the class names and can't be more specific as I'm just not familiar enough with iOS development. I tried searching around and cannot find a specific answer to this question.

Jeremy F
  • 417
  • 2
  • 16
  • This seems to be a [known issue](https://github.com/xamarin/Xamarin.Forms/issues/11030). It’s not clear from the issue when this is targeted to be fixed (looks like it was initially slated for 5.0, but later removed from the roadmap). – esqew May 03 '21 at 19:08
  • Thats interesting but seems perhaps not exactly the scenario I am dealing with. I have just a website thats now hosted inside a webview. The website contains javascript that calls window.alert() is this supposed to work without doing anything special or does some permission need to be set in the iOS xamarin app? All my other javascript "just works" but im not seeing any of the sites window.alert()'s appear. I cant find a straight answer on if this is supposed to just work or not, even on versions of iOS say 10,11,12,13,14. – Jeremy F May 03 '21 at 19:10
  • Thanks @Jason the question you mentioned does appear to indicate that iOS native apps hosting a website that uses window.alert()'s must add specific code to support. That would explain why I'm not seeing any of our alerts() because I don't think our native app developer knew that explicit code had to be added to support this. Thanks. – Jeremy F May 03 '21 at 22:45

0 Answers0