Reputation: 717
I'm programming a react native app for iOS and Android. Inside the app i have a button which function is to share a text and a link.
On Android everything works fine, the dialog opens and show all the possible installed apps to send the link through.
The problem is on the iOS app. Even though I checked to install correctly the library from npm (react-native-share) and also tried the React Native solution (importing Share from de react-native library) the result is the same.
As you can see on the image below, the dialog opens on iPhone but doesn't show anything to share with.
The library is well linked and the info.plist is set up as the instructions on the npm follows.
I hope any of you has any idea of what's happening here. I'm afraid that this problem is related to the configuration of the project or some permissions I have to tell xcode to ask maybe. Here's my code and the image with the behavior.
<ButtonComponent
onPress={() => {
Share.open({
title: 'Share via',
url: 'any link'
})
.then((res) => { console.log(res) })
.catch((err) => { err && console.log(err); })
Upvotes: 1
Views: 1104
Reputation: 717
I finally decided to go for another solution and use ActionSheetIOS and it works correctly. I recommend to use this over 'Share' library if you are programming for ios. It doesn't require as much as configuration and works perfectly.
Upvotes: 0
Reputation: 17
I think you should write LSApplicationQueriesSchemes in
info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
<string>mailto</string>
</array>
Upvotes: 1