Skip to content

Add FDL to M55 #3724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Firebase/DynamicLinks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v4.0.4
- [changed] Removed iOS 7 WebView code causing App Store complaints. (#3722)

# v4.0.3
- [added] Added support for custom domains for internal Google apps. (#3540)

Expand Down
48 changes: 5 additions & 43 deletions Firebase/DynamicLinks/FIRDLJavaScriptExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ @implementation FIRDLJavaScriptExecutor {
__weak id<FIRDLJavaScriptExecutorDelegate> _delegate;
NSString *_script;

// Web views with which to run JavaScript.
UIWebView *_uiWebView; // Used in iOS 7 only.
WKWebView *_wkWebView; // Used in iOS 8+ only.
// Web view with which to run JavaScript.
WKWebView *_wkWebView;
}

- (instancetype)initWithDelegate:(id<FIRDLJavaScriptExecutorDelegate>)delegate
Expand All @@ -82,17 +81,9 @@ - (void)start {
NSString *htmlContent =
[NSString stringWithFormat:@"<html><head><script>%@</script></head></html>", _script];

// Use WKWebView if available as it executes JavaScript more quickly, otherwise, fall back
// on UIWebView.
if ([WKWebView class]) {
_wkWebView = [[WKWebView alloc] init];
_wkWebView.navigationDelegate = self;
[_wkWebView loadHTMLString:htmlContent baseURL:nil];
} else {
_uiWebView = [[UIWebView alloc] init];
_uiWebView.delegate = self;
[_uiWebView loadHTMLString:htmlContent baseURL:nil];
}
_wkWebView = [[WKWebView alloc] init];
_wkWebView.navigationDelegate = self;
[_wkWebView loadHTMLString:htmlContent baseURL:nil];
}

- (void)handleExecutionResult:(NSString *)result {
Expand All @@ -109,8 +100,6 @@ - (void)handleExecutionError:(nullable NSError *)error {
}

- (void)cleanup {
_uiWebView.delegate = nil;
_uiWebView = nil;
_wkWebView.navigationDelegate = nil;
_wkWebView = nil;
}
Expand Down Expand Up @@ -150,33 +139,6 @@ - (void)webView:(WKWebView *)webView
[self handleExecutionError:error];
}

#pragma mark - UIWebViewDelegate

- (void)webViewDidFinishLoad:(UIWebView *)webView {
// Make sure that the javascript was loaded successfully before calling the method.
NSString *methodType =
[webView stringByEvaluatingJavaScriptFromString:FIRDLTypeofFingerprintJSMethodNameString()];
if (![methodType isEqualToString:@"function"]) {
// Javascript was not loaded successfully.
[self handleExecutionError:nil];
return;
}

// Get the result from javascript.
NSString *result =
[webView stringByEvaluatingJavaScriptFromString:GINFingerprintJSMethodString()];
if ([result isKindOfClass:[NSString class]]) {
[self handleExecutionResult:result];
} else {
[self handleExecutionError:nil];
}
}

- (void)webView:(UIWebView *)webView
didFailLoadWithError:(FIRDL_NULLABLE_IOS9_NONNULLABLE_IOS10 NSError *)error {
[self handleExecutionError:error];
}

@end

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion FirebaseDynamicLinks.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseDynamicLinks'
s.version = '4.0.3'
s.version = '4.0.4'
s.summary = 'Firebase DynamicLinks for iOS'

s.description = <<-DESC
Expand Down
1 change: 1 addition & 0 deletions Releases/Manifests/6.8.0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"FirebaseABTesting":"3.1.1",
"FirebaseCore":"6.2.2",
"FirebaseDynamicLinks":"4.0.4",
"FirebaseFirestore":"1.5.0",
"FirebaseInAppMessaging":"0.15.4",
"FirebaseInstanceID":"4.2.4",
Expand Down