react-native-fcm: FirebaseCore/FIRApp.h not found

I am unable to build my app I’m getting FirebaseCore/FIREApp.h not found

I have tried this on a new project as well

my pod file is as follows

  use_frameworks!
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    # Add any other subspecs you want to use in your project
  ]

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

the output is

Using Firebase (3.3.0)
Using FirebaseAnalytics (3.2.1)
Using FirebaseInstanceID (1.0.7)
Using FirebaseMessaging (1.1.0)
Using GoogleIPhoneUtilities (1.2.1)
Using GoogleInterchangeUtilities (1.2.1)
Using GoogleSymbolUtilities (1.1.1)
Using GoogleUtilities (1.3.1)
Using React (0.42.3)
Using Yoga (0.42.3.React)

I am running “react-native”: “0.42”, “react-native-fcm”: “^6.2.0”

my AppDelegate.h is

#import <UIKit/UIKit.h>
@import UserNotifications;

@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>

@end

my AppDelegate.m is

#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#import "RNFIRMessaging.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"EFGConnect"
                                               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];

  // ================ FCM =============================

  [FIRApp configure];
  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

  // ================================================


  return YES;
}

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
{
  [RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler];
}

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler
{
  [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
}

//You can skip this method if you don't want to use local notification
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [RNFIRMessaging didReceiveLocalNotification:notification];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  [RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

@end

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

@bulby97

This worked for me …

Newer versions may require a different set of commands though

pod update pod install --repo-update

Similar to #230

pod updateand pod update repoand everything should be fine

@bulby97 Thanks…!

This worked for me…!

pod update pod install --repo-update

@bulby97 thanks a lot

pod update
pod install --repo-update

did the trick for me

@ifalldev example project has been changed to rely on cocoapod because Firebase didn’t project framework packages for v4.0