-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[share]fix iOS crash when setting the subject to null #2131
Conversation
| @@ -0,0 +1,19 @@ | |||
| import 'dart:async'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
There was a problem hiding this comment.
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 @""; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
cyanglaz
left a comment
There was a problem hiding this 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 @""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; | |||
There was a problem hiding this comment.
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
amirh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
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.
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.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?