In the setup instructions, we are advised to replace any references to pod 'Branch' with pod 'Branch-SDK', path: "../node_modules/react-native-branch/ios".
What is the difference between the two?
For context, I am trying to set up Branch with Segment, and the 'Segment-Branch' pod has the 'Branch' pod as a dependency: Segment-Branch.podspec#L27.
I am getting errors like duplicate interface definition for class 'BNCPreferenceHelper' and property has a previous declaration.
Would I be able to depend on pod 'Branch' instead of pod 'Branch-SDK', path: "../node_modules/react-native-branch/ios"? Or do I need to create a fork of 'Segment-Branch' that doesn't include Branch as a dependent?
CC'ing #379 as it's related
@pcooney10 - if we understand the question correctly then yes pod 'Branch' references have to be changed with pod 'Branch-SDK'. However we think you are facing an issue because you are using Segment-branch inside this which has a pod named branch . Could you try to create a fork of segment-branch and see if it solves the issue else we will try to replicate it .
Hi @sequoiaat, thank you for the response.
Outside of pod 'Branch' references needing to be changed to pod 'Branch-SDK', I guess my question was what is the difference between the two? Would there be a lot of difficulty involved with having the react native implementation for iOS to reference pod 'Branch'? I could be wrong, but it seems like importing #import <Branch/Branch.h> works pretty much the same as #import <react-native-branch/RNBranch.h>, and I can reference both RNBranch and Branch interchangeably.
And I attempted (_or am attempting_ a fork), but it's a bit difficult since the 'Branch-SDK' we need to use is referenced in node_modules. As such, I am not sure how to include it in the Segment-Branch.podspec. In a similar vein, removing this podspec dependency results in a build error as well. WIP here and here.
I am still interested in pursuing the fork if you could maybe provide some color on how I could achieve it, my two attempts are described in the prior paragraph & two links. (I unfortunately have limited experience with Cocoapods and native iOS development). Having the 'Branch-SDK' pod publicly referenceable instead of through the local path also seems like it'd be helpful in this situation, but I am not sure if that's possible.
Thank you again for the responsiveness !
P.S. for anyone else reading along (with limited Cocoapods knowledge like myself), a forked pod can be referenced like this:
pod 'Segment-Branch', :git => 'https://github.com/pcooney10/Segment-Branch-iOS.git', :commit => '1dd544394b097d133d11d47e6b656ec8e4ed7fa1'
We have a solution to this. I've added a pod in 3.0.0-beta.3 that can use the Branch SDK out of the CocoaPods repo for this purpose. This means that you're at risk of using a version that hasn't been tested with the RN SDK. Maybe we can improve matters going forward, but this should finally address this issue for people using Branch with RN and Segment. Apologies for the delay. I should be able to get that out tomorrow.
@jdee I just encountered an issue which seems to be related to this issue. We have version 2.3.0 installed and it's working without any issues so far. We're trying to add Segment-Branch pod in our app, but we see duplicate symbol errors after doing that. I think it's because Branch files are both in Pods folder and in this module. Tried with 3.0.0-beta.3 and I see the same error. Any reason why this library should include Branch SDK (https://github.com/BranchMetrics/react-native-branch-deep-linking/tree/master/ios/Branch-SDK) instead of using it from Pods file as described in this guide -> https://medium.com/shoutem/top-lessons-we-learned-while-building-a-react-native-bridge-library-bd6485cc6212 ("Where to put the native SDK?" part)?
@mlazari Did you make the changes mentioned here?
https://github.com/BranchMetrics/react-native-branch-deep-linking#native-ios-app-using-the-react-pod
You need to change the react-native-branch pod to react-native-branch-segment and remove pod "Branch-SDK". Then run pod install --repo-update. There's no way for the problem to persist after you make those changes. We'll have to get them in a more conspicuous spot.
@jdee We have a pure React Native app, not a native iOS app using the React pod, so that doesn't work for us.
@jdee we were getting the duplicate symbols errors as well and I followed your react-native-branch-segment advice and it worked. However, I did see that step noted in the docs but I still don't know what react-native-branch-segment is (compared to react-native-branch) so I skipped that step. Just some feedback that it wasn't clear in the documentation what to do.
OK. Sorry for the delay. See #426. We're returning to CocoaPods for the native Branch SDK. It's the only reasonable option. This still has some loose ends to be fixed up. Once this is merged and tested, I think we have a 3.0.0 RC.
Regarding the Medium post mentioned above by @mlazari, I added a comment. I think that post is only part of the solution. The comment explains all the decisions that were made for 3.0.0 to address these iOS dependency issues. https://medium.com/@jgvdthree/this-is-useful-advice-but-its-incomplete-c93d93a1d927
Closing this issue now that 3.0.0 is out. Please reopen, open a new issue or contact Branch support if you have further trouble.
Most helpful comment
OK. Sorry for the delay. See #426. We're returning to CocoaPods for the native Branch SDK. It's the only reasonable option. This still has some loose ends to be fixed up. Once this is merged and tested, I think we have a 3.0.0 RC.