diff --git a/ios/RNFirebase/links/RNFirebaseLinks.m b/ios/RNFirebase/links/RNFirebaseLinks.m index 46478d46..d3283f6d 100644 --- a/ios/RNFirebase/links/RNFirebaseLinks.m +++ b/ios/RNFirebase/links/RNFirebaseLinks.m @@ -161,9 +161,11 @@ RCT_EXPORT_METHOD(createShortDynamicLink: (NSDictionary *) metadata resolver:(RC NSLog(@"create short dynamic link failure %@", [error localizedDescription]); reject(@"links/failure", @"Failed to create Short Dynamic Link", error); } - NSURL *shortLink = shortURL; - NSLog(@"created short dynamic link: %@", shortLink.absoluteString); - resolve(shortLink.absoluteString); + else { + NSURL *shortLink = shortURL; + NSLog(@"created short dynamic link: %@", shortLink.absoluteString); + resolve(shortLink.absoluteString); + } }]; } @catch(NSException * e) { diff --git a/lib/modules/links/index.js b/lib/modules/links/index.js index a4c36211..1778c3f5 100644 --- a/lib/modules/links/index.js +++ b/lib/modules/links/index.js @@ -108,13 +108,9 @@ export default class Links extends ModuleBase { * @returns {Promise.} */ createDynamicLink(parameters: Object = {}): Promise { - try { - checkForMandatoryParameters(parameters); - validateParameters(parameters); - return getNativeModule(this).createDynamicLink(parameters); - } catch (error) { - return Promise.reject(error); - } + checkForMandatoryParameters(parameters); + validateParameters(parameters); + return getNativeModule(this).createDynamicLink(parameters); } /** @@ -123,13 +119,9 @@ export default class Links extends ModuleBase { * @returns {Promise.} */ createShortDynamicLink(parameters: Object = {}): Promise { - try { - checkForMandatoryParameters(parameters); - validateParameters(parameters); - return getNativeModule(this).createShortDynamicLink(parameters); - } catch (error) { - return Promise.reject(error); - } + checkForMandatoryParameters(parameters); + validateParameters(parameters); + return getNativeModule(this).createShortDynamicLink(parameters); } }