Skip to content

Commit 171f020

Browse files
authored
Refactoring method names. (#11680)
1 parent d65cecb commit 171f020

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
2424

2525
/**
2626
Class to encapsulate logic related to retrieving pending dynamic link.
27-
In V2 changed comparing to FIRDLDefaultRetrievalProcess:
28-
- removed Java Script fingerprint and replaced by passing device parametres directly to endpoint;
29-
- added device model name to endpoint;
30-
- added handling of iPhone Apps running in compatibility mode on iPad.
3127
*/
3228
@interface FIRDLDefaultRetrievalProcessV2 : NSObject <FIRDLRetrievalProcessProtocol>
3329

FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ - (void)retrievePendingDynamicLinkInternal {
139139
// Disable deprecated warning for internal methods.
140140
#pragma clang diagnostic push
141141
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
142-
// If there is not a unique match, we will send an additional request for fingerprinting.
142+
// If there is not a unique match, we will send an additional request for device heuristics based
143+
// matching.
143144
[_networkingService
144145
retrievePendingDynamicLinkWithIOSVersion:[UIDevice currentDevice].systemVersion
145146
resolutionHeight:resolutionHeight
@@ -245,7 +246,7 @@ - (void)fetchLocaleFromWebView {
245246
if (_jsExecutor) {
246247
return;
247248
}
248-
NSString *jsString = @"window.generateFingerprint=()=>navigator.language||''";
249+
NSString *jsString = @"window.generateDeviceHeuristics=()=>navigator.language||''";
249250
_jsExecutor = [[FIRDLJavaScriptExecutor alloc] initWithDelegate:self script:jsString];
250251
}
251252

FirebaseDynamicLinks/Sources/FIRDLJavaScriptExecutor.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
NS_ASSUME_NONNULL_BEGIN
2727

28-
static NSString *const kJSMethodName = @"generateFingerprint";
28+
static NSString *const kJSMethodName = @"generateDeviceHeuristics";
2929

3030
/** Creates and returns the FDL JS method name. */
31-
NSString *FIRDLTypeofFingerprintJSMethodNameString(void) {
31+
NSString *FIRDLTypeofDeviceHeuristicsJSMethodNameString(void) {
3232
static NSString *methodName;
3333
static dispatch_once_t onceToken;
3434
dispatch_once(&onceToken, ^{
@@ -38,7 +38,7 @@
3838
}
3939

4040
/** Creates and returns the FDL JS method definition. */
41-
NSString *GINFingerprintJSMethodString(void) {
41+
NSString *GINDeviceHeuristicsJSMethodString(void) {
4242
static NSString *methodString;
4343
static dispatch_once_t onceToken;
4444
dispatch_once(&onceToken, ^{
@@ -121,15 +121,15 @@ - (void)webView:(WKWebView *)webView
121121
__weak __typeof__(self) weakSelf = self;
122122

123123
// Make sure that the javascript was loaded successfully before calling the method.
124-
[webView evaluateJavaScript:FIRDLTypeofFingerprintJSMethodNameString()
124+
[webView evaluateJavaScript:FIRDLTypeofDeviceHeuristicsJSMethodNameString()
125125
completionHandler:^(id _Nullable typeofResult, NSError *_Nullable typeError) {
126126
if (typeError) {
127127
[weakSelf handleExecutionError:typeError];
128128
return;
129129
}
130130
if ([typeofResult isEqual:@"function"]) {
131131
[webView
132-
evaluateJavaScript:GINFingerprintJSMethodString()
132+
evaluateJavaScript:GINDeviceHeuristicsJSMethodString()
133133
completionHandler:^(id _Nullable result, NSError *_Nullable functionError) {
134134
__typeof__(self) strongSelf = weakSelf;
135135
if ([result isKindOfClass:[NSString class]]) {

FirebaseDynamicLinks/Sources/FIRDynamicLinkNetworking.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef NS_ENUM(NSInteger, FIRDynamicLinkNetworkingRetrievalProcessType) {
5050
// iSDK performs a server lookup using default match in the background
5151
// when app is first-opened; no API called by developer.
5252
FIRDynamicLinkNetworkingRetrievalProcessTypeImplicitDefault = 1,
53-
// iSDK performs a server lookup by device fingerprint upon a dev API call.
53+
// iSDK performs a server lookup by device heuristics upon a dev API call.
5454
FIRDynamicLinkNetworkingRetrievalProcessTypeExplicitDefault = 2,
5555
// iSDK performs a unique match only if default match is found upon a dev
5656
// API call.

FirebaseDynamicLinks/Sources/FIRDynamicLinks.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ - (nullable FIRDynamicLink *)dynamicLinkFromCustomSchemeURL:(NSURL *)url {
366366
}
367367

368368
if ([url.path isEqualToString:@"/link"] && [url.host isEqualToString:@"google"]) {
369-
// This URL is a callback url from a fingerprint match
369+
// This URL is a callback url from a device heuristics based match
370370
// Extract information from query.
371371
NSString *query = url.query;
372372

FirebaseDynamicLinks/Tests/Unit/FIRDynamicLinksTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ - (void)testCustomScheme_FirstTimeOpenedWithCustomSchemeShouldGetStrongMatch {
407407
XCTAssertEqualObjects(dynamicLink.inviteId, invitationId);
408408
}
409409

410-
- (void)testCustomScheme_FirstTimeOpenedFromFingerprintCodepathShouldGetWeakMatch {
410+
- (void)testCustomScheme_FirstTimeOpenedFromDeviceHeuristicsCodepathShouldGetWeakMatch {
411411
NSString *invitationId = @"21392094021749127-4389172947";
412412

413413
NSString *urlString =
@@ -421,7 +421,7 @@ - (void)testCustomScheme_FirstTimeOpenedFromFingerprintCodepathShouldGetWeakMatc
421421
FIRDynamicLink *dynamicLink = [self.service dynamicLinkFromCustomSchemeURL:url];
422422
XCTAssertEqual(
423423
dynamicLink.matchConfidence, FIRDynamicLinkMatchConfidenceWeak,
424-
@"matchConfidence should be weak when app is first opened from fingerprint codepath.");
424+
@"matchConfidence should be weak when app is first opened from device heuristics codepath.");
425425
XCTAssertNil(dynamicLink.url);
426426
XCTAssertEqualObjects(dynamicLink.inviteId, invitationId);
427427
}

0 commit comments

Comments
 (0)