MitchEff
MitchEff

Reputation: 1557

Universal linking iOS - where is the .xcodeproj file?

I've been trying for days to get Universal Linking working on iOS for React Native.

The docs here say "On iOS, you'll need to link RCTLinking to your project". I'm then told to go to node_modules/react-native/Libraries/LinkingIOS and drag a .xcodeproj file into my project.

None of the libraries in the Libraries folder whatsoever have any .xodeproj files in them.

Is there meant to be? Is my react-native instance missing something? Googling this issue pulls up nothing at all - does everyone else have .xcodeproj files in their Libraries folder??

Upvotes: 9

Views: 3005

Answers (1)

Florin Dobre
Florin Dobre

Reputation: 10252

Starting with version 0.60 React Native provides auto-linking.

To have the library available in RN versions newer than 0.60 you have to:

1) Add reference to LinkingIOS folder into header search paths in

Xcode -> project target -> projectName ->Build Settings -> header search paths:

enter image description here

$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS

2) Import it in AppDelegate.m

#import "RCTLinkingManager.h"

About the other steps that you need to do:

  • upload an apple app site association file to your web server,
  • preparing the app for universal linking in developer.apple.com and
  • setting up universal links in Xcode and RN code

you can check this link:

https://www.ekreative.com/blog/universal-linking-in-react-native-for-ios/

Just ignore the manual linking paragraph on that page.

Upvotes: 23

Related Questions