Monodroid Javascript Call-back

后端 未结 6 1884
时光取名叫无心
时光取名叫无心 2020-12-30 11:53

I\'m trying to use monodroid with webkit to create an app. I am having a problem with letting the html page call a javascript method, which would be an interface to a method

6条回答
  •  既然无缘
    2020-12-30 12:41

    In addition to what jonp said, if you want to send strings back and forth to JavaScript and C# in Android / Xamarin, for instance JSON strings, and you can't use the [Export] attribute, you could try using

    Android.Net.UrlQuerySanitizer.IValueSanitizer
    

    It only has one method

    string Sanitize(string value);
    

    which is handy for passing strings (JSON) between JS and C#. Don't forget to use lower case sanitize in your JavaScript code.

提交回复
热议问题