我正在尝试实现react-native-firebase库以与我的react-native应用程序(在IOS和Android上)一起用于电话身份验证。
第一次尝试运行它时,我得到了Error: The [[DEFAULT]] firebase app has not been initialized!
,因此我正确配置了AppDelegate.m文件。
我尝试删除/重新安装依赖项,重建我的应用程序,但是它总是给我相同的结果。
但是现在我在构建应用程序时似乎总是遇到以下问题:
The following commands produced analyzer issues:
Analyze /Users/xxxx/WebstormProjects/myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
Analyze /Users/xxxx/WebstormProjects/myproject/node_modules/react-native/Libraries/Network/RCTNetInfo.m normal x86_64
我的依赖项:
"firebase": "^5.7.0",
"react": "^16.7.0",
"react-native": "^0.57.8",
"react-native-firebase": "^5.1.1",
AppDelegate.m文件:
#import "AppDelegate.h"
#import <Firebase/Firebase.h>
#import "RNFirebaseNotifications.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
// placed below configuration before RCTRootView initialization
[RNFirebaseNotifications configure];
[FIRApp configure];
Podfile:
target 'snoozelosenative' do
pod 'Firebase/Core', '~> 5.7.0'
pod 'Firebase/Auth'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'React', :path => '../node_modules/react-native', subspecs: [
'Core',
'RCTAnimation',
'RCTActionSheet',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'RCTPushNotification',
'RCTCameraRoll',
'RCTSettings',
'RCTBlob',
'RCTGeolocation',
'DevSupport',
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
end
我只想让Firebase电话身份验证在这两个平台上都可以工作,但不知道我做错了什么。