invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.7k stars 2.22k forks source link

🔥signInWithLink crashes on run #2803

Closed dan-fein closed 4 years ago

dan-fein commented 5 years ago

Describe your issue here As soon as firebase.auth().signInWithEmailLink(email, emailLink) is crashes the app instead of returning an error on iOS.

The code looks like this:

firebase.auth().signInWithEmailLink(email, emailLink)
    .then(response => { 
      this.setState({ error: null, message: "Check your email to log in." })
    }).catch(error => this.setState({ error: error.message }))

Project Files

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'Tabs' do # Pods for Tabs pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app' pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth' pod 'RNFBFirestore', :path => '../node_modules/@react-native-firebase/firestore' pod 'RNFBStorage', :path => '../node_modules/@react-native-firebase/storage' pod 'RNFBPerf', :path => '../node_modules/@react-native-firebase/perf' pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics' pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics' pod 'RNFBInAppMessaging', :path => '../node_modules/@react-native-firebase/in-app-messaging' pod 'RNFBDynamicLinks', :path => '../node_modules/@react-native-firebase/dynamic-links' pod 'RNGoogleSignin', :path => '../node_modules/@react-native-community/google-signin' pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' pod 'react-native-blur', :path => '../node_modules/@react-native-community/blur' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler' pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker' pod 'react-native-login-twitter', :path => '../node_modules/react-native-login-twitter' pod 'RNReanimated', :path => '../node_modules/react-native-reanimated' pod 'RNSearchBar', :path => '../node_modules/react-native-search-bar' pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen' pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' pod 'RCTYouTube', :path => '../node_modules/react-native-youtube' pod 'TwitterKit', '~> 3.3.0' pod 'RNFastImage', :path => '../node_modules/react-native-fast-image' pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob' pod 'RNShare', :path => '../node_modules/react-native-share' pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/' pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' pod 'ReactNativeDarkMode', :path => '../node_modules/react-native-dark-mode' end target 'Tabs-tvOS' do target 'Tabs-tvOSTests' do end end post_install do |installer| installer.pods_project.targets.each do |target| # The following is needed to ensure the "archive" step works in XCode. # It removes React & Yoga from the Pods project, as it is already included in the main project. # Without this, you'd see errors when you archive like: # "Multiple commands produce ... libReact.a" # "Multiple commands produce ... libyoga.a" targets_to_ignore = %w(React yoga) if targets_to_ignore.include? target.name target.remove_from_project end end end ``` #### `AppDelegate.m`: ```objc /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "AppDelegate.h" #import #import #import #import //#import "RNNotifications.h" #import #import "RNSplashScreen.h" @implementation AppDelegate #define TWITTER_SCHEME @"twitterkit-PtC5OrOhqaHFeZwbSktsT1uOF" #define TWITTER_SCHEME_LOWER @"twitterkit-ptc5orohqahfezwbsktst1uof" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; // [RNNotifications startMonitorNotifications]; RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Tabs" initialProperties:nil]; // [[Twitter sharedInstance] startWithConsumerKey:TWITTER_SCHEME consumerSecret:TWITTER_SECRET]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; [RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootViewController.view]; return YES; } ////Added for Notifications: //- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { // [RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; //} // ////Added for Notifications: //- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { // [RNNotifications didFailToRegisterForRemoteNotificationsWithError:error]; //} - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG NSURL *jsUrl = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; [[RCTBundleURLProvider sharedSettings] setJsLocation:jsUrl.host]; return jsUrl; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { if ([[url scheme] isEqualToString:TWITTER_SCHEME]) { NSLog(@"This one doesn't work"); return [[Twitter sharedInstance] application:app openURL:url options:options]; } if ([[url scheme] isEqualToString:TWITTER_SCHEME_LOWER]) { NSLog(@"This one is fine"); return [[Twitter sharedInstance] application:app openURL:url options:options]; } return NO; } @end ```


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 10.15 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Memory: 375.71 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.3 - /usr/local/bin/node Yarn: 1.19.0 - ~/.yarn/bin/yarn npm: 6.9.0 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Android Studio: 3.5 AI-191.8026.42.35.5900203 Xcode: 11.2/11B44 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 npmGlobalPackages: react-native-cli: 2.0.1 ``` - **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [x] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `6.0.2` - **`Firebase` module(s) you're using that has the issue:** - `auth` - **Are you using `TypeScript`?** - `N`

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

msachi commented 1 year ago

Experiencing the same issue.

rob5408 commented 1 year ago

Just in case anyone is as dumb as me, you want to call sendSignInLinkToEmail first.

phuocantd commented 10 months ago

Just in case anyone is as dumb as me, you want to call sendSignInLinkToEmail first.

It still crashes the app. How to fix it?

mikehardy commented 10 months ago

@phuocantd what anyone that could help with your issue needs to see is:

"It still crashes the app and here is the stack trace with all the important information about versions used in the crash..."

phuocantd commented 10 months ago

@phuocantd what anyone that could help with your issue needs to see is:

"It still crashes the app and here is the stack trace with all the important information about versions used in the crash..."

I try .sendSignInLinkToEmail(mail, { handleCodeInApp: true, url: '...' }) It work for me