Reputation: 14210
I am building a phonegap like solution using MonoTouch & UIWebView
. I would like to expose a number of C# methods via Javascript. I know you can do this in Objective C using WebScriptObject
but I can't see where/if this is exposed in the MonoTouch API's.
Is there a way to access WebScriptObject
?
Upvotes: 1
Views: 317
Reputation: 66882
As some additional side answers to this...
Upvotes: 1
Reputation: 3134
Just as as corollary to Sebastian's answer you can always create a simple binding that allows your UIWebView to interact with C# code via a HttpListener:
http://yobriefca.se/blog/2011/12/05/rolling-your-own-phonegap-with-monotouch/
You can also use iOS Background threads to interact with other apps via Javascript or C# using HttpListener:
http://blog.devnos.com/remember-when-apps-didnt-talk-to-each-other
Upvotes: 1
Reputation: 43543
Is there a way to access WebScriptObject?
No, WebScriptObject
is not part of MonoTouch (like it is part in MonoMac) since WebKit
, as a framework, is not part of iOS.
UIWebView
does allow you to evaluate JavaScript code but I'm not sure (never tried or even looked for) how you can, from there, get back into C# methods.
Upvotes: 2