Don't access clipboard passively on iOS#60316
Merged
fluttergithubbot merged 3 commits intoflutter:masterfrom Jun 29, 2020
Merged
Don't access clipboard passively on iOS#60316fluttergithubbot merged 3 commits intoflutter:masterfrom
fluttergithubbot merged 3 commits intoflutter:masterfrom
Conversation
goderbauer
approved these changes
Jun 26, 2020
| // TODO(justinmc): Use the new iOS 14 clipboard API method hasStrings that | ||
| // won't trigger the notification. | ||
| // https://github.com/flutter/flutter/issues/60145 | ||
| if (defaultTargetPlatform == TargetPlatform.iOS) { |
Member
There was a problem hiding this comment.
Use a switch when checking the defaultTargetPlatform.
| }, skip: isBrowser); | ||
| }, skip: isBrowser, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); | ||
|
|
||
| // TODO(justinmc): https://github.com/flutter/flutter/issues/60145 |
|
Started Google testing for this PR |
|
Google testing passed! |
|
Started Google testing for this PR |
|
Google testing passed! |
|
Started Google testing for this PR |
|
Google testing passed! |
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
8 tasks
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
iOS 14 started showing a notification whenever an app accesses the clipboard. Flutter does this in order to decide whether or not it can show the Paste button in the text selection menu (see #54902). As a stopgap solution, this PR removes this functionality on iOS and always shows the Paste button in order to avoid the notification.
The long-term solution involves using a new API provided by Apple. We can use this to detect a pasteable string in the clipboard without reading the text itself. However, the notification will still show when a user presses the paste button. Progress on this long term solution will continue to be tracked in the issue #60145.
Related Issues
#60145
Tests
I tested both cupertino and material on iOS to verify that the Paste button is shown despite there being nothing on the clipboard.
Breaking Change
None.