ios
ios copied to clipboard
[PushNotification] RCTPushNotificationManager.h not found
Bug
I followed everything here (https://github.com/react-native-community/react-native-push-notification-ios ) to use PushNotification on iOS, but when I try to build the app, I get the following error.
RCTPushNotificationManager.h file not found
I even added RCTPushNotification.xcodeproj to Libraries but it still get the same error.
With this package, you're supposed to use
#import <RNCPushNotificationIOS.h>
and
RNCPushNotificationIOS
instead of RCTPushNotificationManager.h and RCTPushNotificationManager
Hi @eramudeep, did you solved this? I'm facing the same issue, I use #import <RNCPushNotificationIOS.h>
and I get the same error, RNCPushNotificationIOS.h file not found
I followed this step: Add the following to your Project: node_modules/@react-native-community/push-notification-ios/ios/PushNotificationIOS.xcodeproj Add the following to Link Binary With Libraries: libRNCPushNotificationIOS.a
Hi,I am also facing same issue please guide here.

Fixed this by 1: Uninstall package 2: Install package again 3: react-native link OR npx react-native link 4: cd ios -> pod install 5: cd .. Done!
Well, following are detailed steps to migrate from @react-native-community/push-notification-ios
-
npm i @react-native-community/push-notification-ios --save
-
Sometime if you have older version of above lib, just remove node-module folder (rm -rf node_modules/) and re-run npm i on project root directory
-
manually link react-native link @react-native-community/push-notification-ios (not need for react native version > 60 but I had to do it as it didn't work for me even if I had version 62).
-
Make sure in iOS/pod file has following updates: remove line: pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS' New link is there: pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
-
Good to run to clean up the pod cache under iOS dir as: rm -rf Pods -- In iOS Folder
-
in iOS dir, run pod install
-
In AppDelegate.m file in you iOS folder perform following:
Replace #import <React/RCTPushNotificationManager.h> with #import <RNCPushNotificationIOS.h>
also find and replace RCTPushNotificationManager with RNCPushNotificationIOS Use following steps for App updates: https://github.com/react-native-community/push-notification-ios/blob/master/example/App.js
-
Build project using react native command react-native run-is or npm run ios. In case build fails, run the project with Xcode with clean build option.
-
Edit your Xcode build option to enable to ask (Product-->Scheme-->Edit Scheme) so that App can run on real iOS device.
-
Make sure you run your app on Android to verify that build is not broken. ./gradlew clean npm run android or react-native run-android
-
Also make sure that on your react-native app where ever you are performing any action related to iOS you check Platform as shown below: if (Platform.OS === 'ios') { notification.finish(PushNotificationIOS.FetchResult.NoData); }

Any update on this issue, i'm also facing the same issue.
For me, it worked. what i did is 1. Changed #import <RNCPushNotificationIOS.h> and RNCPushNotificationIOS instead of RCTPushNotificationManager.h and RCTPushNotificationManager 2. I added Header search path to $(SRCROOT)/../node_modules/@react-native-community/push-notification-ios/ios to non-recursive.. Then clean the project and build it again it worked.
Neither automatic nor manual linking worked for me (RN 0.62), I had to add
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
to my Podfile myself. Then it worked.
I've fixed this by manually adding the following header search path.
"${SRCROOT}/../node_modules/@react-native-community/push-notification-ios/ios"

Just Import to AppDelegate.h file instead of AppDelegate.m file