Skip to content

Commit

Permalink
Fixed broken callback to AppDelegate (#6800)
Browse files Browse the repository at this point in the history
Fixed broken callback to AppDelegate after retrieving a dynamic link during fresh app start.
The AppDelegate call was broken in PR : #6517

Reverting to the old implementation of dynamic link passing to App delegate with changes to remove iOS 9 checks.
Using new "openURL" method instead of the deprecated one.
Clean up in the sample app pod file.
  • Loading branch information
eldhosembabu authored and paulb777 committed Oct 21, 2020
1 parent 0be893d commit 5cc4150
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
9 changes: 9 additions & 0 deletions FirebaseDynamicLinks/Sources/FIRDynamicLinks.m
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,15 @@ - (BOOL)handleIncomingCustomSchemeDeepLink:(NSURL *)url {
}

- (void)passRetrievedDynamicLinkToApplication:(NSURL *)url {
id<UIApplicationDelegate> applicationDelegate = [UIApplication sharedApplication].delegate;
if (applicationDelegate &&
[applicationDelegate respondsToSelector:@selector(application:openURL:options:)]) {
// pass url directly to application delegate to avoid hop into
// iOS handling of the universal links
[applicationDelegate application:[UIApplication sharedApplication] openURL:url options:@{}];
return;
}

[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}

Expand Down
14 changes: 5 additions & 9 deletions FirebaseDynamicLinks/Tests/Sample/Podfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'FDLBuilderTestAppObjC' do
# Comment the next line if you don't want to use dynamic frameworks
platform :ios, '10.0'
use_frameworks!
pod 'FirebaseAnalytics'

pod 'FirebaseCore', :path => '../../../'
pod 'FirebaseInstallations', :path => '../../../'
pod 'FirebaseInstanceID', :path => '../../../'
pod 'FirebaseDynamicLinks', :path => '../../../'
pod 'FirebaseCoreDiagnostics', :path => '../../../'
pod 'GoogleDataTransport', :path => '../../../'
pod 'GoogleUtilities', :path => '../../../'

pod 'FirebaseDynamicLinks', :path => '../../../'
end

0 comments on commit 5cc4150

Please sign in to comment.