react-native-receive-sharing-intent icon indicating copy to clipboard operation
react-native-receive-sharing-intent copied to clipboard

How to install on iOS on react-native 0.59 ?

Open sonlexqt opened this issue 4 years ago • 5 comments

Hi, I tried to installed this package on my RN0.59 project but it didn't work. Here's what I did:

  • yarn add react-native-receive-sharing-intent
  • react-native link react-native-receive-sharing-intent
  • cd ios & pod install => I got this error:
❯ pod install
Analyzing dependencies
Downloading dependencies
Installing react-native-receive-sharing-intent (1.0.4)
[!] Unable to determine Swift version for the following pods:

- `react-native-receive-sharing-intent` does not specify a Swift version and none of the targets (`berrys`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
  • after defining SWIFT_VERSION in my project and run pod install again, I got this error:
pod install
Analyzing dependencies
Downloading dependencies
Installing react-native-receive-sharing-intent (1.0.4)
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-receive-sharing-intent` depends upon `React`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
  • after adding :modular_headers => true to the React line in my Podfile (pod 'React', :path => '../node_modules/react-native, :modular_headers => true'), my pod install command successfully run
  • after that, when I run react-native run-ios I got this error from another library (this error didn't occur before I install react-native-receive-sharing-intent): /Users/sonle/Workspace/BB/berrys-mobile/node_modules/@react-native-firebase/app/ios/RNFBApp/RNFBSharedUtils.h:53:36: expected a type

Any ideas how to fix this issue ? Thanks a lot in advance!

sonlexqt avatar Jun 16 '20 19:06 sonlexqt

Any idea for this issue

vijay2330 avatar Jun 23 '20 11:06 vijay2330

I was able to fix this by adding an empty swift file to my main project and my test project. I didn't need to specify SWIFT_VERSION in the pod file.

jjring avatar Oct 22 '20 22:10 jjring

also have this issue...

djuwon avatar Nov 25 '20 18:11 djuwon

Not sure if anyone else is still trying to fix this. But I figured out how to solve this issue. Basically, I didn't bother with pods. Instead do manually linking by adding the react native receive sharing intent ios file to your library then adding it to your link library with bundle in xcode project settings. Also make sure you have a swift file created in your project and new sharing target.

djuwon avatar Dec 07 '20 18:12 djuwon

I tried to add the ReceiveSharingIntent.xcodeproj manually, then dragged the "libReceiveSharingIntent.a" file to copy to my linked libraries, but after building project getting error "libReceiveSharingIntent.a" not found. Please help

harshalijain avatar Aug 11 '21 10:08 harshalijain