forked from marcuswestin/WebViewJavascriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Changelog
20 lines (17 loc) · 1.35 KB
/
Changelog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
v2.1.1
+ Handle edge cases gracefully (e.g. don't crash on unknown command or unexpected response)
v2.1.0
+ Remove WVJBResponse object and the notion of responding with an error. See 4ab41bb4d7.
v2.0.0
+ Messages are objects instead of strings. Supports NSDictionary*/Objects, NSArray*/Arrays, NSNumber*/Number & NSString*/String.
+ Messages are encoded with NSJSONSerialization. Optional fallback to JSONKit for iOS 4 support.
+ Messages can expect responses. A message received with an expected response is accompanied by a WVJBResponse* object.
+ Handlers can be registered by name, and called with data and an optional expected response.
+ Responses expect either an error or data (`-(void)respond:(id)data`, -(void)respondWithError:(id)error)
v0.0.1
+ ObjC: A WebViewJavascriptBridge class (a UIWebViewDelegate) that enables message passing to and from the JS
+ ObjC: A protocol called WebViewJavascriptBridgeDelegate that lets you handle messages received from the JS
+ JS: Event when the bridge is ready - document.addEventListener('WebViewJavascriptBridgeReady', function() {}, false)
+ JS: Ability to set your message handler - WebViewJavascriptBridge.setMessageHandler(function() {})
+ JS: Function to send messages - WebViewJavascriptBridge.sendMessage('a message');
+ All messages are strings. Use JSON in your js and e.g. JSONKit in iOS to send structured messages