Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Oct 1, 2019

Description

When subject is set to null, iOS will set the subject to NSNull which results a crash.
This PR defaults NSNull to nil before setting the subject.
It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource.
Also fixed a compiler warning with giving originRect an initial value while I'm at it.

Related Issues

flutter/flutter#39740

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@cyanglaz cyanglaz requested a review from amirh October 1, 2019 17:45
@@ -0,0 +1,19 @@
import 'dart:async';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops! How funny that this is included in this PR

}

- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController {
return @"";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious - should this be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per https://developer.apple.com/documentation/uikit/uiactivityitemsource/1620458-activityviewcontrollerplaceholde?language=objc

It should be one that the activity can handle otherwise you may get an activity with empty content.

So setting it to null/nil will result the activityController showing an empty content (manually tested)

Copy link
Contributor Author

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed video player stuff

}

- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController {
return @"";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per https://developer.apple.com/documentation/uikit/uiactivityitemsource/1620458-activityviewcontrollerplaceholde?language=objc

It should be one that the activity can handle otherwise you may get an activity with empty content.

So setting it to null/nil will result the activityController showing an empty content (manually tested)

@@ -0,0 +1,19 @@
import 'dart:async';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops! How funny that this is included in this PR

Copy link
Contributor

@amirh amirh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amirh amirh mentioned this pull request Oct 4, 2019
13 tasks
@cyanglaz cyanglaz merged commit 43620e2 into flutter:master Oct 4, 2019
@jmagman jmagman mentioned this pull request Oct 11, 2019
13 tasks
mormih pushed a commit to mormih/plugins that referenced this pull request Nov 17, 2019
When subject is set to null, iOS will set the subject to NSNull which results a crash.
This PR defaults NSNull to nil before setting the subject.
It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource.
Also fixed a compiler warning with giving originRect an initial value.
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
When subject is set to null, iOS will set the subject to NSNull which results a crash.
This PR defaults NSNull to nil before setting the subject.
It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource.
Also fixed a compiler warning with giving originRect an initial value.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants