找不到“React / RCTDefines.h”文件。在反应原生推送通知集成中

问题描述 投票:0回答:1

我正在我的应用程序中集成推送通知。按照说明2次(来自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

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

xcode react-native push-notification react-native-ios
1个回答
1
投票

我认为你应该将搜索路径设置为recursive。点击Xcode中的项目,请关注此项:

构建设置>标题搜索路径>双击它并单击+符号,然后将以下路径添加到它:

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

另请注意,您必须在Xcode的功能中切换推送通知。

最后关闭你的终端,清除(命令+ k)并重建它(命令+ 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/

我希望我能帮忙。 :)

© www.soinside.com 2019 - 2024. All rights reserved.