找不到'React / RCTDefines.h'文件。在响应本机推送通知集成中

时间:2019-02-07 07:23:53

标签: xcode react-native push-notification react-native-ios

我正在将推送通知集成到我的应用中。再次按照指示执行两次(从here起)后,我陷入了错误。
Podfile

# Uncomment the next line to define a global platform for your project

 platform :ios, '9.0'

target 'placementScript' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
   use_frameworks!

  # Pods for placementScript
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
  target 'placementScript-tvOSTests' do
    #inherit! :search_paths
    # Pods for testing
    pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'

    pod 'RNReactNativeDocViewer', :path => '../node_modules/react-native-doc-viewer'

    pod 'RNFS', :path => '../node_modules/react-native-fs'

    pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

    pod 'RNViewShot', :path => '../node_modules/react-native-view-shot'

  end

  target 'placementScriptTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'placementScript-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for placementScript-tvOS

  #target 'placementScript-tvOSTests' do
   # inherit! :search_paths
    # Pods for testing
  #end

end

当我构建.xcodeproj
-错误是 enter image description here

  • 以及当我使用.xcworkspace构建时

    enter image description here

有人可以帮忙吗?对视频/博客的任何引用也将有所帮助。

1 个答案:

答案 0 :(得分:1)

我认为您应该将搜索路径设置为recursive。单击您在Xcode中的项目,然后执行以下操作:

构建设置>标头搜索路径>双击它,然后单击+号, 然后向其添加以下路径:

$(SRCROOT)/../../../ios/Pods

还请记住,您必须在Xcode的功能中启用推送通知。

最后关闭终端,清除(command + k)并重建(command + R)。 以下是一些来源:

https://medium.com/yale-sandbox/react-native-push-notifications-with-https://medium.com/yale-sandbox/react-native-push-notifications-with-firebase-cloud-functions-74b832d45386

https://ilirhushi.me/reactnative-push-notifications-firebase-ios/

希望我能帮上忙。 :)