react-native-firebase
GitHub: https://github.com/invertase/react-native-firebase
文件: https://rnfirebase.io/docs
npm install --save react-native-firebase
-
下載 Firebase 專案 iOS 應用程式的
GoogleService-Info.plist
,並將檔案放到ios/[YOUR APP NAME]/GoogleService-Info.plist
-
編輯
ios/[YOUR APP NAME]/AppDelegate.m
最上方加入
#import <Firebase.h>
找到 didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
method
在 method 中開頭處加入
[FIRApp configure];
- 安裝 CocoaPods (已經安裝可以略過)
sudo gem install cocoapods
- 初始化 Podfile
cd ios && pod init
-
修改
Podfile
platform :ios, '9.0'
# Required by RNFirebase
pod 'Firebase/Core', '~> 5.11.0'
- link
react-native link react-native-firebase