facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.04k stars 24.07k forks source link

[PushNotification] RCTPushNotificationManager.h not found #3831

Closed jihopark closed 8 years ago

jihopark commented 8 years ago

I followed everything here (https://facebook.github.io/react-native/docs/pushnotificationios.html ) 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.

jihopark commented 8 years ago

fixed by following https://facebook.github.io/react-native/docs/linking-libraries-ios.html

yychun1217 commented 8 years ago

just encountered this issue, thx.

jihopark commented 8 years ago

i think https://facebook.github.io/react-native/docs/pushnotificationios.html should include details about linking libraries

niftylettuce commented 8 years ago

Yeah, definitely. Please update the docs. @jihopark can you please re-open this issue? /cc @yychun1217 @ide

brentvatne commented 8 years ago

@niftylettuce @jihopark - can you submit a pull request please?

niftylettuce commented 8 years ago

@brentvatne I now get some weird archive error message... I can't submit a PR till I figure this out. I wish there were clear instructions for this.

niftylettuce commented 8 years ago

Here's the error: screen shot 2015-11-07 at 6 18 59 pm

It's not an archive for some reason

niftylettuce commented 8 years ago

screen shot 2015-11-07 at 7 03 01 pm

niftylettuce commented 8 years ago

https://github.com/facebook/react-native/pull/1979#issue-94795697

niftylettuce commented 8 years ago

https://medium.com/@DannyvanderJagt/how-to-use-push-notifications-in-react-native-41e8b14aadae

niftylettuce commented 8 years ago

Fixed it, I went into the XCode project for RCTPushNotifications, rebuilt it there after linking headers, and then went and rebuilt my main project. https://github.com/facebook/react-native/issues/1613#issuecomment-154769032

krxsky commented 8 years ago

I just had this issue and was able to fix it with the above comments but there was a gotcha for me... For adding the header search path, I needed to add $(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS instead of $(SRCROOT)/node_modules/react-native/Libraries/PushNotificationIOS for my project to work. (My project was just updated to 0.14.2 from 0.12.0) Hope this helps

christopherdro commented 8 years ago

Looks like RCTPushNotification.xcodeproj is excluded from the rest of the libraries when creating a new project? @ide @nicklockwood Is this intentional?

To get this to work on master I had to add the project files, binary under build phases, and $(SRCROOT)/../node_modules/react-native/Libraries to my projects header search path.

We can update the docs explaining this if the project has been intentionally left out.

ide commented 8 years ago

Let's update the docs.

nicklockwood commented 8 years ago

@christopherdro yes, it's intentional. Apple rejects apps for referencing certain APIs if they aren't used, and PushNotifications is one such API.