You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-45Lines changed: 15 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,49 +50,19 @@ In the dialog that appears:
50
50
WebViewJavascriptBridge.send('Hello from the javascript')
51
51
}, false)
52
52
53
-
5) Optional API: Registered handlers
54
-
55
-
This lets you register named handlers for e.g. command handling. You should register handlers
56
-
57
-
*Note:* You need to 1) register ObjC handlers before loading the UIWebView, and 2) register javascript handlers before calling `WebViewJavascriptBridge.init`.
WebViewJavascriptBridge.callHandler('greetPerson', { name:'Marcus' }, function responseCallback(data) {
82
-
alert("ObjC created greeting: "+ data)
83
-
})
84
-
85
53
iOS4 support (with JSONKit)
86
54
---------------------------
87
55
88
-
WebViewJavascriptBridge uses `NSJSONSerialization` by default. If you need iOS 4 support then you can use [JSONKit](https://github.com/johnezang/JSONKit/), and add `USE_JSONKIT` to the preprocessor macros for your project.
56
+
*Note*: iOS4 support has not yet been tested in v2.
57
+
58
+
WebViewJavascriptBridge uses `NSJSONSerialization` by default. If you need iOS 4 support then you can use [JSONKit](https://github.com/johnezang/JSONKit/), and add `USE_JSONKIT` to the preprocessor macros for your project.
Register a handler called `handlerName`. The javascript can then call this handler with `WebViewJavascriptBridge.callHandler("handlerName", function(response) { ... })`.
Register a handler called `handlerName`. The ObjC can then call this handler with `[bridge callHandler:"handlerName" data:@"Foo"]` and `[bridge callHandler:"handlerName" data:@"Foo" responseCallback:^(id responseData) { ... }]`
0 commit comments