You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Reacted by Anton Savchenko, Woo Kim, Paul Rada, codebymikey, Dennis Brown, Nick, HarvWorks, Thomas Kekeisen, Sergei Nikitin, João Vitor and 29 more
Reacted by solonifer, Niko, David Perez, Montaser Almohasen and Makar Kotlov
Reacted by Thomas Kekeisen, Sergei Nikitin, Hao Tang, kumardastan, Vladimir Nani, dinhtrumdieu, solonifer, JasonTolliver, Óscar Adae Rodríguez, Montaser Almohasen and 3 more
Reacted by oliver-auka, Nate, Aram, Jasulan, Adam Hinkel, akash.j@foodhub.com, Ilia Sidorenko, Montaser Almohasen, Running, Peter and 2 more
Reacted by Thomas Kekeisen, Hao Tang, dinhtrumdieu, solonifer, nnthuc2402, Óscar Adae Rodríguez, Montaser Almohasen, Luis Filipe Alves de Oliveira, Makar Kotlov and ahmedfelah
For example, I had it linked, but I still got this error. Today my coworker updated react-native to 0.31-rc. He said it solved the issue, but I haven't tried myself yet.
Any solutions on that? i have this error on emulator and on iphone it stopped loading the bundle ( might smth else cause this issue with bundle but it happened at the same time = ))
react-native 0.31.0
Same issue on RN 0.32, in iOS, please if anyone has been able to fix this let us know.
BTW – It all works fine on Android, the problem is only in iOS for me... I have linked libraries as per the official PushNotificationIOS docs. Any clues @charlesLin@tomazahlin@hedegren ??
I'm having the same issue. My versions are as follows:
"react-native": "0.39.2",
"react-native-push-notification": "^2.2.1"
I've removed /node_modules /android /ios folders. Then ran the following commands in that order:
npm install
react-native upgrade
react-native link
It seems the culprit is the required/import problem.
If you change the following line from:
const NativeEventEmitter = require('NativeEventEmitter');
to this:
import NativeEventEmitter from 'NativeEventEmitter';
That did the trick. However, I shouldn't be changing the node_modules files. This should be fixed.
Reacted by Ruslan Koloskov, Boris Yankov, Paul Fagan, Alexandre Beauvois, Charlie Viglietta, Abe Clark, Vladimir, Gautam Kishore, Saalis Umer, Muhamad Yulianto and 8 more
add pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS' to ios/Podfile
execute pod install
execute react-native run-ios
After added React-RCTPushNotification to my ios/Podfile, I'm having a duplication problem when building:
duplicate symbol _RCTRemoteNotificationReceived in:
.../Xcode/DerivedData/my-project-xcode-folder/Build/Products/Debug-iphoneos/RNCPushNotificationIOS/libRNCPushNotificationIOS.a(RNCPushNotificationIOS.o)
.../Xcode/DerivedData/my-project-xcode-folder/Build/Products/Debug-iphoneos/React-RCTPushNotification/libReact-RCTPushNotification.a(RCTPushNotificationManager.o)
ld: 1 duplicate symbol for architecture amd64
Reacted by Filip Jarno, Ernestovich, Cosmo Young and shenwangjie
I also had the duplication error when adding React-RCTPushNotification in Podfile, so I didn't add it.
Don't forget to update the import of the PushNotificationIOS module. This ended up solving the problem for me. PushNotificationIOS has been taken out of react-native core.
Change import { PushNotificationIOS } from "react-native";
to import PushNotificationIOS from "@react-native-community/push-notification-ios";
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
Run command in ios directory: pod install
NOTES:
Remove this subspec in your Podfile:
'RCTPushNotification'
Xcode Project
PART 1:
Add node_modules/@react-native-community/push-notification-ios/ios/PushNotificationIOS.xcodeproj
To Directory yourProject/Libraries/
Add libRNCPushNotificationIOS.a
To NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
Screenshot*
PART 2: The reason of this part, is that the import done in AppDelegate.m works fine.
Drag And Drop this folder yourProject/ios/Pods/Headers/Public/RNCPushNotificationIOS
To Build Settings -> Search Paths -> Header Search Paths
Set non-recursive property
Screenshot
NOTES:
Remove RCTPushNotification.xcodeproj from yourProject/Libraries
Make sure libRTCPushNotification.a disappeared from NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
Was able to figure this out thanks to the above 3 answers and everyone else on this thread 😄 .
If you're on RN ^0.59 and rn-push-notifications ^3.1.9:
react-native link @react-native-community/push-notification-ios
The 'missing native module' is the linked @community library. RPN 3.1.3 -> 3.1.9 updated to use the community library over the native one, but that step is missing from the Getting Started docs
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
Run command in ios directory: pod install
NOTES:
Remove this subspec in your Podfile:
'RCTPushNotification'
Xcode Project
PART 1:
Add node_modules/@react-native-community/push-notification-ios/ios/PushNotificationIOS.xcodeproj
To Directory yourProject/Libraries/
Add libRNCPushNotificationIOS.a
To NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
Screenshot*
PART 2: The reason of this part, is that the import done in AppDelegate.m works fine.
Drag And Drop this folder yourProject/ios/Pods/Headers/Public/RNCPushNotificationIOS
To Build Settings -> Search Paths -> Header Search Paths
Set non-recursive property
Screenshot
NOTES:
Remove RCTPushNotification.xcodeproj from yourProject/Libraries
Make sure libRTCPushNotification.a disappeared from NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
@Ovsdrak I cannot Drag And Drop RNCPushNotificationIOS folder to Header Search Paths because there is no folder in yourProject/ios/Pods/Headers/Public/ folder (I did pod install).
So I get error on build as 'React/RCTEventEmitter.h' file not found in RNCPushNotificationIOS.h
Activity
tomazahlin commentedon Aug 1, 2016
I have the same problem today on iOS.
I think this has nothing to do with this repository, might be better to submit this issue / ask for help in react-native repository.
On the other hand, if this repository is using "require" instead of "import", the issue might be here. I did not manage to solve this problem today.
fmnxl commentedon Aug 2, 2016
I think you need to link it first:
https://facebook.github.io/react-native/docs/pushnotificationios.html
tomazahlin commentedon Aug 2, 2016
For example, I had it linked, but I still got this error. Today my coworker updated react-native to 0.31-rc. He said it solved the issue, but I haven't tried myself yet.
charlesLin commentedon Aug 10, 2016
I run it on real iPad device successfully, but got the same error on iOS emulator.
info:
react-native 0.31.0
zo-chu commentedon Aug 14, 2016
Any solutions on that? i have this error on emulator and on iphone it stopped loading the bundle ( might smth else cause this issue with bundle but it happened at the same time = ))
react-native 0.31.0
bkhanal commentedon Sep 5, 2016
I am getting the same error, has this been fixed. I am on RN 0.32
npomfret commentedon Sep 15, 2016
Have you checked in your MainApplicaiton that its been linked correctly? I think this is a common cause of this issue
CharlieIGG commentedon Sep 20, 2016
Same issue on RN 0.32, in iOS, please if anyone has been able to fix this let us know.
BTW – It all works fine on Android, the problem is only in iOS for me... I have linked libraries as per the official PushNotificationIOS docs. Any clues @charlesLin @tomazahlin @hedegren ??
thbwd commentedon Sep 26, 2016
Rebuilding and running the app from Xcode did the trick for me.
littlemaneuver commentedon Oct 8, 2016
You do really need to go through manual procedure to get it work https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking if you don't have a developer account in apple center
npomfret commentedon Oct 10, 2016
No, just follow the instructions in the readme.
tanapaydin commentedon Feb 10, 2017
I'm having the same issue. My versions are as follows:
I've removed /node_modules /android /ios folders. Then ran the following commands in that order:
It seems the culprit is the required/import problem.
If you change the following line from:
to this:
That did the trick. However, I shouldn't be changing the node_modules files. This should be fixed.
liftyourgame commentedon Apr 16, 2017
Where do you change the require to import? What file(s)?
quantuminformation commentedon Apr 27, 2017
Just done a fresh RN latest install and get the same error.
17 remaining items
brenwell commentedon Mar 28, 2019
Just a note for anyone as dumb as me. I have multiple RN projects and I had this problem because I had metro running for the wrong project
cumen commentedon Aug 5, 2019
remove react-native-push-notification in node_modules
run
npm install react-native-push-notification@3.1.3ziaulrehman40 commentedon Aug 8, 2019
Thanks @cumen This happened to me after an upgrade from
3.1.3to3.1.8. Strange thing is changelog is not yet there in https://github.com/zo0r/react-native-push-notification/blob/master/CHANGELOG.mdGabeConsalter commentedon Aug 8, 2019
After added
React-RCTPushNotificationto myios/Podfile, I'm having a duplication problem when building:thijs-qv commentedon Aug 15, 2019
I also had the duplication error when adding React-RCTPushNotification in Podfile, so I didn't add it.
Don't forget to update the import of the PushNotificationIOS module. This ended up solving the problem for me. PushNotificationIOS has been taken out of react-native core.
Change
import { PushNotificationIOS } from "react-native";to
import PushNotificationIOS from "@react-native-community/push-notification-ios";Ovsdrak commentedon Aug 15, 2019
Solution FOUND!
Platform: iOS
Problem: Native module cannot be null
Error line:
var PushNotification = require('react-native-push-notification');SOLUTION
NOTES:
Do NOT use this docs:
https://facebook.github.io/react-native/docs/pushnotificationios
USE this ones:
https://github.com/zo0r/react-native-push-notification
https://github.com/react-native-community/react-native-push-notification-ios
Package.json
In your package.json consider this (ignore react native version):
"react-native": "0.59.9"
"react-native-push-notification": "^3.1.8",
"@react-native-community/push-notification-ios": "^1.0.2",
Run command:
npm installPodfile
Add this pod to your Podfile
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'Run command in ios directory:
pod installNOTES:
Remove this subspec in your Podfile:
'RCTPushNotification'
Xcode Project
PART 1:
Add
node_modules/@react-native-community/push-notification-ios/ios/PushNotificationIOS.xcodeprojTo Directory
yourProject/Libraries/
Add
libRNCPushNotificationIOS.a
To
NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
Screenshot*

PART 2: The reason of this part, is that the import done in AppDelegate.m works fine.
Drag And Drop this folder
yourProject/ios/Pods/Headers/Public/RNCPushNotificationIOS
To
Build Settings -> Search Paths -> Header Search Paths
Set non-recursive property
Screenshot

NOTES:
Remove RCTPushNotification.xcodeproj from yourProject/Libraries
Make sure libRTCPushNotification.a disappeared from NameProject -> Targets -> NameProject -> Build Phases -> Link Binary With Libraries
AppDelegate.m
Add this import to your AppDelegate.m file:
#import "RNCPushNotificationIOS.h"Add this in the @implementation section.
NOTES:
Remove
#import <React/RCTPushNotificationManager.h>sushrutha commentedon Aug 19, 2019
@Ovsdrak This solution works! Thank you!
omererbil commentedon Aug 25, 2019
USE those libraries:
https://github.com/zo0r/react-native-push-notification
https://github.com/react-native-community/react-native-push-notification-ios
follow step by step,
everything will work
no need anything else
not foget to pod install
kazuooooo commentedon Oct 29, 2019
@Ovsdrak kind answer perfect for me! thanks!
kazuooooo commentedon Nov 5, 2019
This error also occured old import way.
need to fix to this
fkotsian commentedon Nov 26, 2019
Was able to figure this out thanks to the above 3 answers and everyone else on this thread 😄 .
If you're on RN ^0.59 and rn-push-notifications ^3.1.9:
The 'missing native module' is the linked @community library.
RPN3.1.3 -> 3.1.9 updated to use the community library over the native one, but that step is missing from the Getting Started docs🎉 😄 👍
eramudeep commentedon Dec 30, 2019
Great Worked for me
Thank you
ErtugrulBEKTIK commentedon Jan 21, 2020
@Ovsdrak I cannot Drag And Drop RNCPushNotificationIOS folder to Header Search Paths because there is no folder in yourProject/ios/Pods/Headers/Public/ folder (I did pod install).
So I get error on build as 'React/RCTEventEmitter.h' file not found in RNCPushNotificationIOS.h
Any ideas?
lukewlms commentedon Aug 27, 2020
Mocked the whole
react-native-push-notificationlibrary and that seems to work well.Source: jestjs/jest#2208 (comment)