Closed vkourtis closed 2 years ago
Can you let us know if this still happens with up to date versions:
"@react-native-firebase/app": "12.7.5",
"@react-native-firebase/auth": "12.7.5",
"@react-native-firebase/dynamic-links": "12.7.5",
"@react-native-firebase/firestore": "12.7.5",
"@react-native-firebase/remote-config": "12.7.5",
"react-native": "0.64.2",
Troubleshooting old versions isn't something worth spending time on, as the issues you are experiencing may be fixed or may behave differently
If you want to stay on the old versions and troubleshoot on your side, inspect the android and ios logs via adb logcat
and Xcode console while this happens to see if the data is coming in and just wrapped poorly / not exposed (ios), or look at the firebase-android-sdk. / firebase-ios-sdk repos to find the error message for blocking-function (maybe just check out + grep through to start...)
You can also reach right in to node_modules and modify the objective-c / java to print things out in the logs that you should now be watching, and you can then log all the parameters out prior to the calls and all the return values etc on the callbacks / error handlers to see if the info is there + what it is
When you do that, if you see that something isn't quite right at the native level, the next step for resolution it so to use one of the quickstarts to demonstrate the behavior to the upstream teams in their issue tracker and pursue to resolution (https://github.com/firebase/quickstart-android/tree/master/auth / https://github.com/firebase/quickstart-ios/tree/master/authentication)
Looks like at minimum there is some issue with their identity platform documentation vs the SDK behavior and an undocumented code that is worth pursuing
Or if it's something here then obviously we can pursue repair.
I seem to recall something on our side (react-native-firebase) about ios auth internal-error maybe not getting the internal details back out to userland but it may be resolved
I did some updates on the libraries, to make sure we're not looking at an old bug here. So, now I have the following:
"@react-native-firebase/app": "^14.5.1",
"@react-native-firebase/auth": "^14.5.1",
"@react-native-firebase/dynamic-links": "^14.5.1",
"@react-native-firebase/firestore": "^14.5.1",
"@react-native-firebase/remote-config": "^14.5.1",
"react-native": "0.66.4",
The result is the same.
To add some extra info, when I run createUserWithEmailAndPassword
on iOS, I get an error (of type: FirebaseAuthTypes.NativeFirebaseAuthError
) that contains the following data:
{
error: "An internal error has occurred, please try again.,
at FirebaseAuthModule.createUserWithEmailAndPassword [...]",
code: "auth/internal-error",
message: "[auth/internal-error] An internal error has occurred, please try again.",
name: "Error",
namespace: "auth",
nativeErrorCode: null,
nativeErrorMessage: "An internal error has occurred, print and inspect the error details for more information."
userInfo {
code: "internal-error",
message: "An internal error has occurred, please try again.",
authCredential: null,
nativeErrorMessage: "An internal error has occurred, print and inspect the error details for more information."
}
}
Doing the same try on Android, we get:
{
error: "[auth/blocking-function] An internal error has occurred.
[ BLOCKING_FUNCTION_ERROR_RESPONSE:HTTP Cloud Function returned an error:
{"error":{"code":409,"message":"Email already exists","status":"ALREADY_EXISTS"}} ]
at FirebaseAuthModule.createUserWithEmailAndPassword [...]",
code: "auth/blocking-function",
message: "[auth/blocking-function] An internal error has occurred.
[ BLOCKING_FUNCTION_ERROR_RESPONSE:HTTP Cloud Function returned an error:
{"error":{"code":409,"message":"Email already exists","status":"ALREADY_EXISTS"}} ]",
name: "Error",
namespace: "auth",
nativeErrorCode: null,
nativeErrorMessage: null,
userInfo {
[... INFO REPEATED FROM ABOVE ...]
}
}
@mikehardy thank you for your suggestions. I'm following them and trying to dig deeper for more info. I will let you know as soon as I have news. Let me know if you have any more ideas.
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.
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.
Issue
We use Google's Identity Platform to authenticate our users. During user creation, we use a blocking cloud function (i.e.
beforeCreate
) to do some work on our backend.There is a case where this blocking function throws an error following the conventions here.
Web working as expected On our web client (using the js firebase library), we get the error as described in the documentation. This means, we get an
auth/internal-error
with a stringified payload in the message.Android (on react native) works but not as documented On the Android client (using the react-native-firebase library), we get the corresponding error is found in the error message (as in web), but the error code is
auth/blocking-function
, which I could not find in the documentation.iOS (on react native) does not work On the iOS client (using the react-native-firebase library), we don't get the error anywhere. Instead we get a generic
auth/internal-error
with a generic message:An internal error has occurred, please try again.
I have also looked into the
nativeErrorCode
andnativeErrorMessage
properties, which are:null
andAn internal error has occurred, print and inspect the error details for more information.
Project Files
Javascript
Click To Expand
#### `package.json`: ```json { "name": "XXXXX", "version": "6.0.13", "private": true, "license": "LicenseRef-LICENSE", "scripts": { [...] }, "dependencies": { "@react-native-community/async-storage": "~1.12.0", "@react-native-community/datetimepicker": "^3.0.9", "@react-native-community/masked-view": "0.1.10", "@react-native-community/netinfo": "^6.0.2", "@react-native-community/progress-bar-android": "1.0.4", "@react-native-community/progress-view": "1.2.3", "@react-native-community/slider": "3.0.3", "@react-native-firebase/app": "12.7.5", "@react-native-firebase/auth": "12.7.5", "@react-native-firebase/dynamic-links": "12.7.5", "@react-native-firebase/firestore": "12.7.5", "@react-native-firebase/remote-config": "12.7.5", "@react-native-picker/picker": "1.9.4", "@react-navigation/native": "5.4.0", "@react-navigation/stack": "5.3.7", "@sentry/react-native": "^3.2.3", "@types/react-native-base64": "^0.1.0", "@types/react-native-event-source": "^1.1.0", "@types/react-native-htmlview": "0.12.2", "@types/react-native-share": "3.3.0", "@types/react-native-snap-carousel": "3.8.2", "array-flat-polyfill": "^1.0.1", "axios": "0.21.2", "expo": "^40.0.0", "moment": "2.26.0", "native-base": "2.13.12", "olio-sitka": "1.1.0", "patch-package": "^6.4.7", "react": "17.0.1", "react-dom": "16.13.1", "react-hook-form": "5.7.2", "react-native": "0.64.2", "react-native-add-calendar-event": "^4.0.0", "react-native-base64": "^0.2.1", "react-native-ble-manager": "^7.4.2", "react-native-ble-plx": "^2.0.2", "react-native-code-push": "^7.0.4", "react-native-component-inview": "^1.0.2", "react-native-config": "^1.4.2", "react-native-date-picker": "^4.1.3", "react-native-device-info": "^8.0.5", "react-native-document-picker": "^5.0.2", "react-native-dropdown-picker": "^5.2.3", "react-native-easy-grid": "^0.2.2", "react-native-event-source": "^1.1.0", "react-native-exit-app": "^1.1.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "~1.8.0", "react-native-gifted-chat": "0.16.3", "react-native-htmlview": "0.16.0", "react-native-image-resizer": "1.2.6", "react-native-inline-calendar": "https://github.com/olioapps/react-native-inline-calendar.git", "react-native-input-spinner": "^1.7.7", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-keychain": "6.0.0", "react-native-linear-gradient": "^2.5.6", "react-native-modal": "11.5.6", "react-native-nordic-dfu": "^3.2.0", "react-native-onesignal": "^4.3.3", "react-native-pdf": "6.2.2", "react-native-permissions": "^3.0.4", "react-native-progress": "4.1.2", "react-native-reanimated": "~1.13.0", "react-native-responsive-screen": "1.4.1", "react-native-safe-area-context": "3.1.9", "react-native-screens": "~2.15.2", "react-native-scroll-into-view": "^2.0.2", "react-native-share": "4.1.0", "react-native-simple-animations": "^0.2.3", "react-native-simple-dialogs": "^1.4.0", "react-native-snap-carousel": "3.9.1", "react-native-sse": "^1.0.5", "react-native-svg": "^12.1.0", "react-native-svg-transformer": "^0.14.3", "react-native-swipe-list-view": "3.2.3", "react-native-unimodules": "~0.12.0", "react-native-webview": "^11.14.2", "react-redux": "7.2.0", "redux": "4.0.5", "redux-devtools-extension": "^2.13.9", "redux-logger": "3.0.6", "redux-persist": "6.0.0", "redux-saga": "1.1.3", "rn-fetch-blob": "0.12.0", "rxjs": "^6.6.6", "use-debounce": "^5.2.1", "utility-types": "^3.10.0" }, "devDependencies": { "@babel/core": "7.9.6", "@sentry/cli": "^1.71.0", "@storybook/addon-actions": "^6.3.12", "@storybook/addon-knobs": "^6.3.1", "@storybook/addon-links": "^6.3.12", "@storybook/addon-ondevice-actions": "^5.3.23", "@storybook/addon-ondevice-knobs": "^5.3.25", "@storybook/react-native": "5.3.25", "@storybook/react-native-server": "^5.3.23", "@types/jest": "26.0.20", "@types/react": "~16.9.35", "@types/react-native": "~0.63.2", "@types/react-redux": "7.1.9", "@typescript-eslint/eslint-plugin": "4.14.2", "@typescript-eslint/parser": "4.14.2", "babel-loader": "^8.2.2", "babel-preset-expo": "8.3.0", "eslint": "7.0.0", "eslint-plugin-prettier": "3.1.3", "eslint-plugin-react": "7.20.0", "eslint-plugin-react-native": "3.8.1", "firebase-tools": "^9.20.0", "husky": "5.0.9", "jest-expo": "^43.0.1", "lerna": "^4.0.0", "lint-staged": "10.5.4", "lorem-ipsum-react-native": "^1.0.3", "metro-symlinked-deps": "^2.0.0", "prettier": "2.2.1", "react-native-clean-project": "^3.6.3", "react-native-storybook-loader": "^2.0.2", "typescript": "~4.0.0" }, "lint-staged": { "src/**/*.{js,jsx,ts,tsx,json,css}": [ "eslint --fix" ], "*.{js,jsx,ts,tsx,css}": [ "eslint --fix" ] }, "jest": { "preset": "jest-expo", "transform": { "^.+\\.[jt]sx?$": "babel-jest" }, "transformIgnorePatterns": [ "node_modules/(?!@react-native|react-native)" ] }, "config": { "react-native-storybook-loader": { "pattern": "**/*.stories.tsx", "outputFile": "./storybook/storyLoader.js" } }, "resolutions": { "prismjs": "1.27.0", "glob-parent": "5.1.2", "set-value": "4.0.1", "immer": "9.0.6", "highlight.js": "10.4.1", "react-dev-utils": "11.0.4", "xmldom": "0.5.0", "browserslist": "4.16.5", "node-fetch": "2.6.7", "nth-check": "2.0.1", "json-ptr": "3.0.0", "promise": "^8.0.3", "marked": "4.0.10" } } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```
iOS
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/react-native-unimodules/cocoapods' require_relative '../node_modules/react-native-unimodules/cocoapods.rb' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '13.0' project 'XXXXX', 'Storybook.Debug' => :debug, 'Storybook.Release' => :release, 'Debug' => :debug, 'Release' => :release, 'Release.Production' => :release target 'XXXXX' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) # Other native modules permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral" # Temporary fix https://github.com/dotintent/react-native-ble-plx/issues/899#issuecomment-929490351 pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1.9' # Automatically detect installed unimodules use_unimodules! permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral" # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') post_install do |installer| flipper_post_install(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end end end target 'OneSignalNotificationServiceExtension' do pod 'OneSignalXCFramework', '>= 3.0', '< 4.0' end ``` #### `AppDelegate.m`: ```objc #import "AppDelegate.h" #import
#import
#import
#ifdef FB_SONARKIT_ENABLED
#import
#import
#import
#import
#import
#import
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
#import
#import
#import
#import
#import "RNNordicDfu.h"
#import "BleManager.h"
#import
#import
@interface AppDelegate ()
@end
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
options:(NSDictionary *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
[RNNordicDfu setCentralManagerGetter:^() {
return [BleManager getCentralManager];
}];
// Reset manager delegate since the Nordic DFU lib "steals" control over it
[RNNordicDfu setOnDFUComplete:^() {
NSLog(@"onDFUComplete");
CBCentralManager * manager = [BleManager getCentralManager];
manager.delegate = [BleManager getInstance];
}];
[RNNordicDfu setOnDFUError:^() {
NSLog(@"onDFUError");
CBCentralManager * manager = [BleManager getCentralManager];
manager.delegate = [BleManager getInstance];
}];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"main"
initialProperties:nil];
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];
return YES;
}
- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge
{
NSArray> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
// You can inject any extra modules that you would like here, more information at:
// https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
return extraModules;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [CodePush bundleURL];
#endif
}
@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:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **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:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`
React Native Firebase
andInvertase
on Twitter for updates on the library.