Note: react-native-background-geolocation-firebase
requires Cocoapods. If you haven't yet configured your project for Cocaopods, first initialize your Podfile
:
$ cd ios
$ pod init
$ npm install --save react-native-background-geolocation-firebase
$ react-native link react-native-background-geolocation-firebase
To open your project in XCode, use the file YourProject.xcworkspace
(not YourProject.xcodeproj
)
react-native-firebase
, this step will already have been performed.
#import "AppDelegate.h"
.
.
.
+#import <Firebase/Firebase.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"FirebaseFoo"
initialProperties:nil
launchOptions:launchOptions];
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];
+ [FIRApp configure];
return YES;
}
react-native-firebase
, this step will already have been performed.
After adding import to AppDelegate.m
you need to install the new pod settings:
cd ios
pod install
react-native-firebase
, this step will already have been performed.
From your Firebase Console, copy your downloaded Google-Services-Info.plist
file into your application:
Undefined symbols for architecture armv7: “_OBJC_CLASS_$_FIRApp”
During pod installation, you may see warnings related to OTHER_LDFLAGS
or other flags. To fix the issue, select the target of your project and add $(inherited)
flag in Build Settings
. You can reference this Stack Overflow issue for more details.