Merge pull request #511 from rmrs/omer_links

Dynamic Links - ios bug fixes
This commit is contained in:
Michael Diarmid 2017-10-15 12:04:23 +01:00 committed by GitHub
commit 60a9f879ff
3 changed files with 12 additions and 8 deletions

View File

@ -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",

View File

@ -2,13 +2,13 @@
#define RNFirebaseLinks_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseDynamicLinks/FIRDynamicLinks.h>)
#import <Firebase.h>
#if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
#import <FirebaseDynamicLinks/FirebaseDynamicLinks.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
@interface RNFirebaseLinks : RCTEventEmitter<RCTBridgeModule> {
}
+ (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url

View File

@ -1,6 +1,7 @@
#import "RNFirebaseLinks.h"
#if __has_include(<FirebaseDynamicLinks/FIRDynamicLink.h>)
#if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
#import <Firebase.h>
#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"]];
}