RN v0.41.2
react-native-branch v1.0.2
Followed the tutorial exactly
npm installed
react-native linked it
added all the needed code to AppDelegate.m, put #import <react-native-branch/RNBranch.h>
as the header at the top of the AppDelegate.m
When I try to compile the project this gets thrown:
pathtotheproject/node_modules/react-native-branch/ios/BranchLinkProperties+RNBranch.h:9:9: 'Branch/Branch.h' file not found
Here is the output from pod install, cd ios; pod install --repo-update:

Here is my podfile content:
use_frameworks!
pod "Branch"
target "watson"
target "watsonTests"
@jdee I've seen similiar issues in this repo, but seems like solutions listed in them didnt work for me :/
On android seems like it compiles fine, its just ios.
Is it possible to install react-native-branch without any pods involvement?
Like drag and drop or reference that SDK in the project itself?
@Amurmurmur Thanks for the report. There's one thing you didn't mention that I want to confirm: Are you opening the xcworkspace or the xcodeproj in the ios subdirectory of your project (probably called watson.xcodeproj and watson.xcworkspace)? CocoaPods generates the xcworkspace. You need to use that instead of the xcodeproj. That's responsible for passing around certain build settings. Also, you can just try react-native run-ios to build and run on a simulator.
The other option besides CocoaPods is to use Carthage, which is a little more like just dragging the SDK into your project. In a future release, we'll probably just bundle the native SDK or SDKs (iOS at least) into the NPM module so that there's no risk of a version mismatch and no need for CocoaPods or Carthage. For now, those are the only real options.
There are two working examples in this repo in the testbed folder. One uses Carthage, the other CocoaPods. Those might give you some insight into how to set things up. Also, this works fine for me:
react-native init TestProject
cd TestProject
yarn
npm install --save react-native-branch
react-native link
cd ios
# set up a Podfile like yours
pod install
cd ..
react-native run-ios
I wouldn't worry about those warnings from CocoaPods. They're normal and shouldn't cause a problem.
@jdee It works great for Debug and Release type builds. Greatly appreciated !!!!
However I have an additional build type called Staging (using it with react-native-code-push for prerelease testing), and on build, it throws the same as before you have helped in your comment above:
pathtotheprojectroot/node_modules/react-native-branch/ios/RNBranchProperty.h:9:9: 'Branch/Branch.h' file not found
And
pathtotheprojectroot/node_modules/react-native-branch/ios/BranchLinkProperties+RNBranch.h:9:9: 'Branch/Branch.h' file not found
@Amurmurmur Thanks for the feedback. I'm glad that helped.
Support for custom build configurations out of the box is something that will require some thought on our part. For now, I may have a manual workaround for you. You just have to add your Staging configuration to the RNBranch project. I am a little skeptical about the situation because I just tried this with testbed_cocoapods, and each of the React projects in the Libraries group has the same problem. If you already had your RN app working with a Staging configuration, something must have been done to make those projects work. That means you either have to make these manual changes to all the Libraries projects every time you update RN and modules like react-native-branch, or you have some other means of handling it. If you have automation that updates these projects to include the Staging configuration, maybe you just need to include the RNBranch project. I'm not sure how this would work otherwise.
For example, this blog post provides a Ruby script to automate the process. If you were using that script, you'd need to add support for RNBranch.xcodeproj in the sync-build-configs.rb script in find_and_fix_projects starting at line 220.
Nevertheless, the following manual steps ought to let the RNBranch project find the pod in the Staging configuration.

I think this is enough to resolve the header problem.
Obviously we need to find a way to automate this properly.
Looks like there's an issue with React Native not supporting custom build configurations well right now - https://github.com/facebook/react-native/issues/11813.
I needed to add:
$(BUILT_PRODUCTS_DIR)/../Release-$(PLATFORM_NAME)/include
to the Release Configuration Header Search Paths setting in RNBranch in addition to creating new configurations in the RNBranch project so that RNBranch could locate the Release React Headers properly:
see: https://github.com/facebook/react-native/issues/11813#issuecomment-273279257
@Amurmurmur @ippy04 It is actually quite easy to set up custom build configurations on iOS using CocoaPods. That is, you don't use react-native link at all, but you get all the native React code from the pod in node_modules rather than from the Libraries group. This SDK supports it, and it's entirely equivalent to using react-native link. See:
Basically, CocoaPods provides all the automation to support custom configurations. You don't have to do anything special with CP. It will just happen.
It does require that all your native dependencies (all the projects in the Libraries group) support CocoaPods, meaning they have to include a podspec file in their NPM module (or possibly publish a pod to CocoaPods). This could be a problem. For example, I don't think react-native-navigation provides a podspec. It's not the end of the world. You can always write a podspec to wrap things from node_modules, and that won't have to be updated each time the dependency updates, unlike the Xcode project files.
At any rate, this may provide a strategy for a solution. Supporting this for react-native link is going to depend on RN itself or some sort of standard automation, unfortunately.
If you want to try converting your project to CocoaPods and have questions or problems, please feel free to ask.
Most helpful comment
@Amurmurmur Thanks for the report. There's one thing you didn't mention that I want to confirm: Are you opening the xcworkspace or the xcodeproj in the ios subdirectory of your project (probably called watson.xcodeproj and watson.xcworkspace)? CocoaPods generates the xcworkspace. You need to use that instead of the xcodeproj. That's responsible for passing around certain build settings. Also, you can just try
react-native run-iosto build and run on a simulator.The other option besides CocoaPods is to use Carthage, which is a little more like just dragging the SDK into your project. In a future release, we'll probably just bundle the native SDK or SDKs (iOS at least) into the NPM module so that there's no risk of a version mismatch and no need for CocoaPods or Carthage. For now, those are the only real options.
There are two working examples in this repo in the testbed folder. One uses Carthage, the other CocoaPods. Those might give you some insight into how to set things up. Also, this works fine for me:
I wouldn't worry about those warnings from CocoaPods. They're normal and shouldn't cause a problem.