question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Share.shareSingle() throws unhandled promise rejection only on ios

See original GitHub issue

Hi. this library is working fine on all cases on android but i am running into few issues on ios. My implementation of this lib is with a custom view component with icons when clicked will initiate the sharing process.

Environment:

"react": "16.2.0",
"react-native": "^0.53.3"
"react-native-share": "^1.0.27"

Using share as: import Share from 'react-native-share';

I have a facebook icon when pressed calls:

this.props.setTimeout(() => { Share.shareSingle({ ...this.state.shareOptions, social: 'facebook' }) }, 50);

Android produces desired behaviour however on ios i get the warning below.

Possible Unhandled Promise Rejection (id: 0):
Object {
  "error": Object {
    "code": "ECOM.RNSHARE1",
    "domain": "com.rnshare",
    "message": "The operation couldn’t be completed. Not installed",
    "nativeStackIOS": Array [
      "0   TestApp                          0x000000010ff94b26 RCTJSErrorFromCodeMessageAndNSError + 134",
      "1   TestApp                          0x000000010ff94a53 RCTJSErrorFromNSError + 275",
      "2   TestApp                          0x000000010ff25058 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.187 + 152",
      "3   TestApp                          0x000000010fe93c8d -[GenericShare shareSingle:failureCallback:successCallback:serviceType:] + 2301",
      "4   TestApp                          0x000000010fe91f75 -[RNShare shareSingle:failureCallback:successCallback:] + 373",
      "5   CoreFoundation                      0x0000000119118ccc __invoking___ + 140",
      "6   CoreFoundation                      0x0000000119118b84 -[NSInvocation invoke] + 308",
      "7   CoreFoundation                      0x00000001191318d6 -[NSInvocation invokeWithTarget:] + 54",
      "8   Battledore                          0x000000010ff2803c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2796",
      "9   TestApp                          0x000000010ffdc012 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 786",
      "10  TestApp                          0x000000010ffdbb3f _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 127",
      "11  TestApp                          0x000000010ffdbab9 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25",
      "12  libdispatch.dylib                   0x0000000119f3773b _dispatch_call_block_and_release + 12",
      "13  libdispatch.dylib                   0x0000000119f38779 _dispatch_client_callout + 8",
      "14  libdispatch.dylib                   0x0000000119f42778 _dispatch_main_queue_callback_4CF + 1279",
      "15  CoreFoundation                      0x0000000119157c99 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9",
      "16  CoreFoundation                      0x000000011911bea6 __CFRunLoopRun + 2342",
      "17  CoreFoundation                      0x000000011911b30b CFRunLoopRunSpecific + 635",
      "18  GraphicsServices                    0x000000011cf3ea73 GSEventRunModal + 62",
      "19  UIKit                               0x0000000114f6f0b7 UIApplicationMain + 159",
      "20  TestApp                          0x000000010fe9195f main + 111",
      "21  libdyld.dylib                       0x0000000113b5a955 start + 1",
    ],
    "userInfo": Object {
      "NSLocalizedFailureReason": "Not installed",
    },
  },
}

When i share it through whatsapp on ios, it takes me to the apple store and on pressing back to return to my app i get an error.

screen shot 2018-05-22 at 13 13 00

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:48 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
thanhcuong1990commented, Oct 2, 2018

I’ve same issue on iOS Simulator. It’s should be fixed like this:

Share.shareSingle(shareOptions).catch((err) => { err && console.log(err); });
2reactions
chathura88commented, May 20, 2021

@smaelbarry I’m on the same RN version (0.63.4). this is my current info.plist please check if you have followed all the steps in https://react-native-share.github.io/react-native-share/docs/install

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>tg</string>
  <string>capcut</string>
  <string>lark</string>
  <string>viber</string>
  <string>fbapi</string>
  <string>fb-messenger-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
  <string>kakao61f447fe9723aa9c0b67a52eeb998e77</string>
  <string>kakaokompassauth</string>
  <string>storykompassauth</string>
  <string>kakaolink</string>
  <string>kakaotalk-5.9.7</string>
  <string>storylink</string>
  <string>line</string>
  <string>instagram</string>
  <string>instagram-stories</string>
  <string>lineauth</string>
  <string>line3rdp.com.zhiliaoapp.musically</string>
  <string>whatsapp</string>
  <string>fb-messenger-platform-20150714</string>
  <string>fb-messenger-platform-20150305</string>
  <string>fb-messenger-platform-20150218</string>
  <string>fb-messenger-platform-20150128</string>
  <string>zalo</string>
  <string>snapchat</string>
  <string>twitter</string>
  <string>twitterauth</string>
  <string>bandapp</string>
  <string>kakaostory</string>
  <string>navercafe</string>
  <string>naverblog</string>
  <string>vkauthorize</string>
  <string>vk</string>
  <string>vk-share</string>
  <string>fb</string>
  <string>fb-messenger-share-api</string>
  <string>fb-messenger</string>
  <string>itms-beta</string>
  <string>heloiossso</string>
  <string>comgooglemaps</string>
  <string>resso</string>
</array>
Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-share promise rejection error - Stack Overflow
I think you need to add RNShare.xcodeproj to your Project' Libraries and then go to General->Linked Frameworks and Libraries, ...
Read more >
Share.shareSingle | React Native Share - GitHub Pages
This shared message may contain text, one or more files, or both. Open the share dialog with the specific application. This returns a...
Read more >
[Solved]-react-native-share promise rejection error-Reactjs
Coding example for the question react-native-share promise rejection ... could not get Share.open() to work, but I did manage to get Share.share() to...
Read more >
[Unhandled promise rejection: SyntaxError: Unexpected token ...
Error : Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe ...
Read more >
HELP!!! My Async Await with Try Catch return Unhandled ...
I keep coming across "Unhandled Promise Rejection" when I try to combine ... throw err } } return check }) } showOtherResponse() {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found