diff --git a/ios/RNFirebase.xcodeproj/project.pbxproj b/ios/RNFirebase.xcodeproj/project.pbxproj index 7a513286..ac43d99f 100644 --- a/ios/RNFirebase.xcodeproj/project.pbxproj +++ b/ios/RNFirebase.xcodeproj/project.pbxproj @@ -431,6 +431,7 @@ "${SRCROOT}/../../../ios/Pods/FirebaseCore/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseCrash/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseDatabase/Frameworks", + "${SRCROOT}/../../../ios/Pods/FirebaseDynamicLinks/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseFirestore/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseInstanceID/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseMessaging/Frameworks", @@ -469,6 +470,7 @@ "${SRCROOT}/../../../ios/Pods/FirebaseCore/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseCrash/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseDatabase/Frameworks", + "${SRCROOT}/../../../ios/Pods/FirebaseDynamicLinks/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseFirestore/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseInstanceID/Frameworks", "${SRCROOT}/../../../ios/Pods/FirebaseMessaging/Frameworks", diff --git a/ios/RNFirebase/links/RNFirebaseLinks.h b/ios/RNFirebase/links/RNFirebaseLinks.h index e89dfa17..ac96b7e6 100644 --- a/ios/RNFirebase/links/RNFirebaseLinks.h +++ b/ios/RNFirebase/links/RNFirebaseLinks.h @@ -2,13 +2,13 @@ #define RNFirebaseLinks_h #import -#if __has_include() -#import +#if __has_include() +#import #import #import @interface RNFirebaseLinks : RCTEventEmitter { - + } + (BOOL)application:(UIApplication *)app openURL:(NSURL *)url diff --git a/ios/RNFirebase/links/RNFirebaseLinks.m b/ios/RNFirebase/links/RNFirebaseLinks.m index ceb14296..350eb25b 100644 --- a/ios/RNFirebase/links/RNFirebaseLinks.m +++ b/ios/RNFirebase/links/RNFirebaseLinks.m @@ -1,6 +1,7 @@ #import "RNFirebaseLinks.h" -#if __has_include() +#if __has_include() +#import #import "RNFirebaseEvents.h" @@ -49,11 +50,12 @@ RCT_EXPORT_MODULE(); return [self handleLinkFromCustomSchemeURL:url]; } -+(BOOL)handleLinkFromCustomSchemeURL:(NSURL *)url { ++ (BOOL)handleLinkFromCustomSchemeURL:(NSURL *)url { FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url]; - if (dynamicLink) { - sendDynamicLink(dynamicLink.url, self); + if (dynamicLink && dynamicLink.url) { + NSURL* dynamicLinkUrl = dynamicLink.url; + sendDynamicLink(dynamicLinkUrl, self); return YES; } return NO; @@ -194,7 +196,7 @@ RCT_EXPORT_METHOD(createShortDynamicLink: (NSDictionary *) metadata resolver:(RC if (androidParametersDict) { FIRDynamicLinkAndroidParameters *androidParams = [FIRDynamicLinkAndroidParameters parametersWithPackageName: androidParametersDict[@"androidPackageName"]]; - + if (androidParametersDict[@"androidFallbackLink"]) { androidParams.fallbackURL = [NSURL URLWithString:androidParametersDict[@"androidFallbackLink"]]; }