|
|
@@ -23,6 +23,7 @@
|
|
|
#import <GoogleUtilities/GULSwizzler+Unswizzle.h>
|
|
|
#import <GoogleUtilities/GULSwizzler.h>
|
|
|
#import <OCMock/OCMock.h>
|
|
|
+#import "FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.h"
|
|
|
#import "FirebaseDynamicLinks/Sources/FIRDLRetrievalProcessFactory.h"
|
|
|
#import "FirebaseDynamicLinks/Sources/FIRDLRetrievalProcessResult+Private.h"
|
|
|
#import "FirebaseDynamicLinks/Sources/FIRDynamicLink+Private.h"
|
|
|
@@ -1171,6 +1172,31 @@ static NSString *const kInfoPlistCustomDomainsKey = @"FirebaseDynamicLinksCustom
|
|
|
isClassSelector:NO];
|
|
|
}
|
|
|
|
|
|
+- (void)test_retrievePendingDeepLinkShouldSetkFIRDLOpenURLKeyRegardlessOfFailures {
|
|
|
+ [self.service setUpWithLaunchOptions:nil
|
|
|
+ apiKey:kAPIKey
|
|
|
+ clientID:kClientID
|
|
|
+ urlScheme:nil
|
|
|
+ userDefaults:[NSUserDefaults standardUserDefaults]];
|
|
|
+ FIRDynamicLinks<FIRDLRetrievalProcessDelegate> *deleagte =
|
|
|
+ (FIRDynamicLinks<FIRDLRetrievalProcessDelegate> *)self.service;
|
|
|
+
|
|
|
+ // Error Result to pass
|
|
|
+ FIRDLRetrievalProcessResult *result = [[FIRDLRetrievalProcessResult alloc]
|
|
|
+ initWithDynamicLink:nil
|
|
|
+ error:[NSError errorWithDomain:@"unknown domain" code:500 userInfo:nil]
|
|
|
+ message:nil
|
|
|
+ matchSource:nil];
|
|
|
+
|
|
|
+ FIRDLDefaultRetrievalProcessV2 *defaultRetrievalProcess = [FIRDLDefaultRetrievalProcessV2 alloc];
|
|
|
+
|
|
|
+ [deleagte retrievalProcess:defaultRetrievalProcess completedWithResult:result];
|
|
|
+
|
|
|
+ NSString *kFIRDLOpenURLKey = @"com.google.appinvite.openURL";
|
|
|
+ XCTAssertEqual([[NSUserDefaults standardUserDefaults] boolForKey:kFIRDLOpenURLKey], YES,
|
|
|
+ @"kFIRDLOpenURL key should be set regardless of failures");
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Self-diagnose tests
|
|
|
|
|
|
- (void)testSelfDiagnoseWithNilCompletion {
|