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.

Sharing on iOS 11 leads to duplicated content on "Copy & Paste"

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
  OS:  macOS Sierra 10.12.6
  Node:  7.7.1
  Yarn:  0.27.5
  npm:  4.1.2
  Watchman:  4.7.0
  Xcode:  Xcode 9.0 Build version 9A235
  Android Studio:  2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.0.0-alpha.12 => 16.0.0-alpha.12
  react-native: ^0.48.4 => 0.48.4

Steps to Reproduce

  1. Install iOS 11

  2. Create a vanilla React Native app

    1. Install Create React Native App: npm install -g create-react-native-app
    2. Create a new app: create-react-native-app AwesomeProject
    3. Launch packager: cd AwesomeProject && npm start
  3. Add some UI and trigger a share action:

    Share.share({message: "The message", title: "The title", url: "http://facebook.github.io"}) 
    
  4. Choose “Copy” from the UIActivityViewController

  5. Open the “Notes” app and paste the clipboard

Expected Behavior

The URL should not be duplicated

Actual Behavior

The URL is duplicated when the clipboard is pasted

Screenshot:

img_2462

Video capture: https://www.youtube.com/watch?v=i7BuwwNHYqg

Reproducible Demo

Snack: https://snack.expo.io/r1KP-GYhW

Insights

From my findings this is a bug of UIActivityViewController in iOS 11:

Changing the implementation in RCTActionSheetManager.m slightly seems to solve this issue:

Replace [items addObject:URL]; with [items addObject:URL.absoluteString];

solves the issue. For me sharing to other apps (e.g. Facebook) still works. Another option would be to add iOS version checks here or to wait for Apple to fix this problem (might only take some years).

I’m more than happy to provide this little change as a PR.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
stale[bot]commented, Dec 27, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

1reaction
ethanneffcommented, Oct 13, 2017

Go to the App Store and share an app via copy. You will see it’s a iOS bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cut, copy, and paste between iPhone and other devices
Cut or copy content on your iPhone, then paste it on another iPhone, iPad, iPod touch, or Mac computer, and vice versa.
Read more >
Seamlessly transfer content between your devices
Try copying and pasting smaller sections between your devices. If the feature is already turned on but you're still unable to copy and...
Read more >
Duplicating pages and content - Squarespace Help Center
With copy and paste shortcuts, you can duplicate blocks from one Fluid Engine section to another: While editing, click the block you want...
Read more >
How to Copy and Paste Text on iPhone - YouTube
Watch this video tutorial to learn how to copy and paste text on iPhone or iPad. The buttons are in a hidden menu,...
Read more >
How to copy and paste on your iPad or iPhone, and from one ...
You can copy text and images on an iPhone or iPad just by tapping and holding on the content for a moment until...
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