[Bug]: iOS Device Freezes When Sharing File via Unopened Social Media Account
Platform
Any iOS device
Plugin
share_plus
Version
9.0.0
Flutter SDK
3.19.6
Steps to reproduce
I have an iOS device with the Telegram application installed, but I haven't created an account or logged in. Despite this, when attempting to share a file through Telegram, my phone freezes. The issue arises due to the absence of a logged-in account within Telegram. Upon encountering this problem, the following log is displayed in the console:
"[NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement +_allowedItemPayloadClasses. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error."
On Android devices, however, sharing a file via Telegram without a prior logged-in account does not result in any errors or phone freezes. The share operation returns a success status, with the raw result being returned as com.google.android.gm/com.google.android.gm.ComposeActivityGmailExternal."
Steps to reproduce:
- Log out from any desired social media platform (e.g., Instagram, Telegram).
- Select any file to share and optionally add a caption.
- Attempt to share the file using the social media platform from which you've fully logged out.
Code Sample
Future<void> sharePlus(String path) async{
print('LOOK: STARTED');
try{
final result = await Share.shareXFiles(
[XFile(path)],
text: null, //LocaleKeys.receipt.tr(),
);
switch(result.status){
case ShareResultStatus.success:
print('LOOK: SUCCESS: ${result.raw}');
case ShareResultStatus.dismissed:
print('LOOK: DISMISSED: ${result.raw}');
case ShareResultStatus.unavailable:
print('LOOK: UNAVAILABLE: ${result.raw}');
}
} catch(e){
print('LOOK: ERROR = $e');
}
}
Logs
[NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement +_allowedItemPayloadClasses. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error.
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-UZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.88.0)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone 13 Pro. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• No issues found!
Checklist before submitting a bug
- [X] I searched issues in this repository and couldn't find such bug/problem
- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I'm using the latest version of the plugin
- [X] All dependencies are up to date with
flutter pub upgrade - [X] I did a
flutter clean - [X] I tried running the example project