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.

Twitter shareSingle error: url

See original GitHub issue

Steps to reproduce

Run a simple

Share.shareSingle(shareOptions)
                    .then((res) => { console.log(res) })
                    .catch((err) => { err && console.log(err); })

where shareOptions has the deafult values (title, message, urls (with base64 encoded images) and subject). use “twitter” as social

Expected behaviour

Open twitter app if is installed, otherwise just open the default sharing dialog.

Actual behaviour

Nothing happens, and it throws the following error: {error: "url"}

Environment

  • React Native version: 0.57.5
  • React Native platform + platform version: Android 8

react-native-share

Version: “master” (currently 1.1.3)

N.B I use the same code for: facebook, instagram, googleplus, whatsapp and email, and it works perfectly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
koo27commented, Jan 31, 2019

For now I just did this workaround. I open a simple share dialog in case of error to not stuck the app if twitter button has clicked.

Share.shareSingle(shareOptions)
                    .then((res) => { console.log(res) })
                    .catch((err) => {
                        if (err) {
                            console.log(err);
                            Share.open(shareOptions)
                        }
                    })

I noticed that this happens also with Facebook and Google Plus if I don’t have the apps installed on the smartphone (tested only on android so far).

0reactions
stale[bot]commented, Aug 2, 2019

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twitter shareSingle error: url · Issue #443 · react-native-share ...
I open a simple share dialog in case of error to not stuck the app if twitter button has clicked. Share.shareSingle(shareOptions) ...
Read more >
Twitter Share Wrong URL - How To Fix It?
The problem appears when short URLs are using. And it is related to a wrong cached short URL inside the plugin. Easy Social...
Read more >
Share.shareSingle | React Native Share - GitHub Pages
The shareSingle() method allows a user to share a premade message via a single ... const shareOptions = { title: 'Share via', message:...
Read more >
sharing image, link and title using react-native-share not working
What I've tried and didn't worked: Sharing URL of images instead of base64 - Only image is shared, message got removed. And in...
Read more >
Sharing content in React Native apps using React Native Share
Let's start with something simple: sharing a link. ... shareSingle(customOptions); } catch (err) { console.log(err); } };.
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