react-native-receive-sharing-intent
react-native-receive-sharing-intent copied to clipboard
How to install on iOS on react-native 0.59 ?
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'
), mypod 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 installreact-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!
Any idea for this issue
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.
also have this issue...
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.
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