plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: Gmail and Slack share_plus bug on iOS

Open marialaguna opened this issue 2 years ago • 7 comments

Platform

iOS 16.3.1

Plugin

share_plus

Version

^7.0.2

Flutter SDK

3.7.0

Steps to reproduce

I found two issues while trying to share a link on an iOS device using the Share.share(url) method. Everything works fine on Android devices.

1. Gmail app When I try to share a link via Gmail app, the link itself is set as the subject of the email. Even if I set a subject to the method (Share.share(url, subject: "Hi there!")), the subject always keep the shared text, which in this case is a link.

To solve the problem I had to enter a line break before the url String. Like this: Share.share("\n$url").

2. Slack app When I try to share a link via Slack app, the preview message is shown empty. If the message is sent to the chat like that, empty, the link is shared in the selected chat. But if a enter a something in the "Type a message here, if you'd like!" field, the link is erased and just the message I just tipped is sent.

I haven't found a workaround to make the link appear in Slack, neither adding a line break, a text or a subject, the preview message is always empty.

Code Sample

void shareLink() async {
String url = "https://example.com";
await Share.share(url);
}

Logs

[+8890 ms] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
[        ] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[ +146 ms] <CATransformLayer: 0x280f53d40> - changing property backgroundColor in transform-only layer, will have no effect
[   +3 ms] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
[        ] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
[        ] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] -imageForImageDescriptor: can do IO please adopt -imageForDescriptor: for IO free drawing or -prepareImageForDescriptor: if IO is allowed. (This will become a fault soon.)
[        ] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
[        ] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
[        ] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66,
_LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
[        ] [default] -imageForImageDescriptor: can do IO please adopt -imageForDescriptor: for IO free drawing or -prepareImageForDescriptor: if IO is allowed. (This will become a fault soon.)
[        ] [LayoutConstraints] Changing the translatesAutoresizingMaskIntoConstraints property of a UICollectionReusableView that is managed by a UICollectionView is not supported, and will result in incorrect self-sizing. View:
<_UIActivityContentFooterView: 0x132d1dce0; baseClass = UICollectionReusableView; frame = (16 427.667; 343 52); layer = <CALayer: 0x280f27800>>

Flutter Doctor

[✓] Flutter (Channel stable, 3.7.0, on macOS 13.1 22C65 darwin-arm64, locale en-ES)
    • Flutter version 3.7.0 on channel stable at /Users/marialagunaperez/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (6 months ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/marialagunaperez/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • ANDROID_HOME = /Users/marialagunaperez/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/marialagunaperez/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.79.2)
    • VS Code at /Users/marialagunaperez/VS Code/Visual Studio Code.app/Contents
    • Flutter extension version 3.68.0

[✓] Connected device (4 available)
    • 21061119DG (mobile)   • 15d8d16a0508              • android-arm64  • Android 11 (API 30)
    • MariaTrendio (mobile) • 00008110-00004522260A801E • ios            • iOS 16.3.1 20D67
    • macOS (desktop)       • macos                     • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)          • chrome                    • web-javascript • Google Chrome 114.0.5735.198

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Checklist before submitting a bug

  • [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

marialaguna avatar Jul 10 '23 11:07 marialaguna

not able to send text with files to whatsapp. any fixes

Sachinsowri avatar Jul 31 '23 06:07 Sachinsowri

Any update on this? It is happening with share_plus: ^7.1.0 as well.

shahbazhashmi avatar Aug 17 '23 06:08 shahbazhashmi

We are seeing this issue too, any update?

SwingTweakSteve avatar Sep 06 '23 18:09 SwingTweakSteve

Hi - any updates pls?

sudha-anecure avatar Nov 28 '23 23:11 sudha-anecure

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Feb 27 '24 00:02 github-actions[bot]

FYI, if you want to share a URI, use the shareUri not the share method, as it makes sure the OS shows the correct preview information and handles the URI correctly.

There is also the possiblity to add the "subject" param to the shareUri method, is someone wants to do a PR with that change, I will help review it.

miquelbeltran avatar Feb 27 '24 09:02 miquelbeltran

@miquelbeltran it works! thank you

marialaguna avatar Mar 06 '24 16:03 marialaguna

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Jun 05 '24 00:06 github-actions[bot]