|
@@ -107,7 +107,7 @@
|
|
|
|
|
|
|
|
[self.wkwebView.configuration.userContentController addScriptMessageHandler:self name:@"Signature"];
|
|
[self.wkwebView.configuration.userContentController addScriptMessageHandler:self name:@"Signature"];
|
|
|
[self.wkwebView.configuration.userContentController addScriptMessageHandler:self name:@"SelectContact"];
|
|
[self.wkwebView.configuration.userContentController addScriptMessageHandler:self name:@"SelectContact"];
|
|
|
-
|
|
|
|
|
|
|
+ [self.wkwebView.configuration.userContentController addScriptMessageHandler:self name:@"requestApplicationVersion"];
|
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Color"];
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Color"];
|
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Pay"];
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Pay"];
|
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Shake"];
|
|
// [self.configuration.userContentController addScriptMessageHandler:self name:@"Shake"];
|
|
@@ -129,6 +129,7 @@
|
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"DatetimePicker"];
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"DatetimePicker"];
|
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"Signature"];
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"Signature"];
|
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"SelectContact"];
|
|
[self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"SelectContact"];
|
|
|
|
|
+ [self.wkwebView.configuration.userContentController removeScriptMessageHandlerForName:@"requestApplicationVersion"];
|
|
|
}
|
|
}
|
|
|
- (void)dealloc
|
|
- (void)dealloc
|
|
|
{
|
|
{
|
|
@@ -553,6 +554,16 @@
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)ra_requestAppVersion:(NSDictionary *)params {
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
|
|
|
|
|
+ NSString *ver = [infoDic objectForKey:@"CFBundleShortVersionString"];
|
|
|
|
|
+ NSString *build = [infoDic objectForKey:@"CFBundleVersion"];
|
|
|
|
|
+ NSString *appVer = [NSString localizedStringWithFormat:@"Ver: %@ build %@",ver,build];
|
|
|
|
|
+
|
|
|
|
|
+ [self returnToWebPage:params value:appVer];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - Utils
|
|
#pragma mark - Utils
|
|
|
|
|
|
|
|
- (NSString *)adjustNilString:(NSString *)str {
|
|
- (NSString *)adjustNilString:(NSString *)str {
|
|
@@ -748,6 +759,9 @@
|
|
|
} else if ([message.name isEqualToString:@"SelectContact"]) {
|
|
} else if ([message.name isEqualToString:@"SelectContact"]) {
|
|
|
|
|
|
|
|
[self handleSelectContact:params];
|
|
[self handleSelectContact:params];
|
|
|
|
|
+ } else if ([message.name isEqualToString:@"requestApplicationVersion"]) {
|
|
|
|
|
+
|
|
|
|
|
+ [self handleRequestApplicationVersion:params];
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -865,6 +879,10 @@
|
|
|
[self ra_selectContact:params];
|
|
[self ra_selectContact:params];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)handleRequestApplicationVersion:(NSDictionary *)params {
|
|
|
|
|
+ [self ra_requestAppVersion:params];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - WKNavigationDelegate
|
|
#pragma mark - WKNavigationDelegate
|
|
|
|
|
|
|
|
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation {
|
|
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation {
|