Skip to content

Commit 64a89a3

Browse files
committed
Merge branch 'master' of git://github.com/xzeror/WebViewJavascriptBridge into blockCopy
Conflicts: WebViewJavascriptBridge/WebViewJavascriptBridge.m
2 parents f3d749b + 3b57d6c commit 64a89a3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

WebViewJavascriptBridge.podspec

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Pod::Spec.new do |s|
2+
s.name = "WebViewJavascriptBridge"
3+
s.version = "2.1.1"
4+
s.summary = "A standalone iOS class for sending messages to and from javascript in a UIWebView."
5+
s.homepage = "http://github.com/marcuswestin/WebViewJavascriptBridge"
6+
s.license = { :type => "MIT", :file => "LICENSE" }
7+
s.author = { "marcuswestin" => "[email protected]" }
8+
s.source = { :git => "https://github.com/marcuswestin/WebViewJavascriptBridge.git", :tag => "2.1.1" }
9+
s.platform = :ios, "4.2"
10+
s.source_files = "WebViewJavascriptBridge/WebViewJavascriptBridge.{h,m}"
11+
s.resource = "WebViewJavascriptBridge/WebViewJavascriptBridge.js.txt"
12+
s.framework = "UIKit"
13+
s.dependency "JSONKit"
14+
end

WebViewJavascriptBridge/WebViewJavascriptBridge.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ - (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJB
6969
}
7070

7171
- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler {
72-
self.messageHandlers[handlerName] = handler;
72+
self.messageHandlers[handlerName] = [handler copy];
7373
}
7474

7575
- (void)reset {
@@ -83,7 +83,7 @@ - (void)_sendData:(NSDictionary *)data responseCallback:(WVJBResponseCallback)re
8383

8484
if (responseCallback) {
8585
NSString* callbackId = [NSString stringWithFormat:@"objc_cb_%d", ++_uniqueId];
86-
self.responseCallbacks[callbackId] = responseCallback;
86+
self.responseCallbacks[callbackId] = [responseCallback copy];
8787
message[@"callbackId"] = callbackId;
8888
}
8989

0 commit comments

Comments
 (0)