Skip to content

Commit

Permalink
Merge pull request #6 from 453jerry/feature/JSAction_support_progress…
Browse files Browse the repository at this point in the history
…_update

Release 1.1
  • Loading branch information
453jerry authored Dec 10, 2019
2 parents 9150865 + 053c191 commit efb18a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ALBridge.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
#

spec.name = "ALBridge"
spec.version = "1.0.0"
spec.version = "1.1.0"
spec.summary = "ALBridge is a javascript bridge(JSBridge) for WKWebView on iOS."

# This description is used to generate tags and improve search results.
Expand Down
6 changes: 3 additions & 3 deletions ALBridge/ALBridge/ALBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import WebKit

public typealias JSActionCompletionCallback = (_ callbackParameter: String) -> Void
public typealias JSActionCompletionCallback = (_ result: String) -> Void

public typealias JSActionProgresseChangedCallback = (_ progress: Int) -> Void

Expand Down Expand Up @@ -79,7 +79,7 @@ public class ALBridge: NSObject, WKScriptMessageHandler {
return
}

let callback = { (callbackParameter: String?) in
let callback = { (result: String?) in
guard let callbackHandler = callbackHandler else {
return
}
Expand All @@ -89,7 +89,7 @@ public class ALBridge: NSObject, WKScriptMessageHandler {
userInfoJSONStr = String.init(data: jsonData, encoding: .utf8)
}
}
let callbackJSCode = "\(callbackHandler)(\(callbackParameter ?? "null"), \(userInfoJSONStr ?? "null"))"
let callbackJSCode = "\(callbackHandler)(\(result ?? "null"), \(userInfoJSONStr ?? "null"))"

scriptMessage.webView?.evaluateJavaScript(callbackJSCode, completionHandler: nil)
}
Expand Down

0 comments on commit efb18a3

Please sign in to comment.