Skip to content

Commit

Permalink
Release 1.6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhan ZOU committed Sep 23, 2016
1 parent f819b40 commit 5511e9f
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -320,40 +320,6 @@ - (NSString *)webViewJavascriptBridgeCallbackInfo {
return [jsonString copy];
}

- (void)showUpWebView:(id)webView {
SADebug(@"showUpWebView");
if (webView == nil) {
SADebug(@"showUpWebView == nil");
}
NSString *js = [NSString stringWithFormat:@"sensorsdata_app_js_bridge_call_js('%@')", [self webViewJavascriptBridgeCallbackInfo]];
if ([webView isKindOfClass:[UIWebView class]] == YES) {//UIWebView
SADebug(@"showUpWebView: UIWebView");
[webView stringByEvaluatingJavaScriptFromString:js];
}
#if defined(supportsWKWebKit )
else if([webView isKindOfClass:[WKWebView class]] == YES) {//WKWebView
SADebug(@"showUpWebView: WKWebView");
[webView evaluateJavaScript:js completionHandler:^(id _Nullable response, NSError * _Nullable error) {
NSLog(@"response: %@ error: %@", response, error);
}];
}
#endif
else{
SADebug(@"showUpWebView: not UIWebView or WKWebView");
return;
}
}

- (NSString *)webViewJavascriptBridgeCallbackInfo {
JSONUtil *_jsonUtil = [[JSONUtil alloc] init];
NSMutableDictionary *libProperties = [[NSMutableDictionary alloc] init];
[libProperties setValue:@"iOS" forKey:@"type"];
[libProperties setValue:[self distinctId] forKey:@"distinct_id"];
NSData* jsonData = [_jsonUtil JSONSerializeObject:libProperties];
NSString* jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
return [jsonString copy];
}

- (void)enableAutoTrack {
_autoTrack = YES;
}
Expand Down

0 comments on commit 5511e9f

Please sign in to comment.