social_share_kit 0.2.0
social_share_kit: ^0.2.0 copied to clipboard
Share text, links and files directly to X, WhatsApp, Instagram, Threads, Telegram, LinkedIn, Messenger, TikTok, SMS and mail, or to the system share sheet. Reports per-target capabilities up front. Bu [...]
Changelog #
0.2.0 #
Adds ShareTargetHandler, an extension seam letting an add-on package take
over individual targets.
This exists so the no-vendor-SDK stance does not have to be all-or-nothing. The
first add-on, social_share_kit_facebook, uses it to upgrade
ShareTarget.facebook to the native Share Dialog — including on iOS, where the
core package cannot serve it at all. Apps that do not want the Facebook SDK
keep a package with zero required setup.
SocialShareKit.registerHandler/unregisterHandler/handlerFor.- A handler can widen a target's capabilities, and validation honours the widened entry — otherwise core would reject content before the handler ran.
capabilities,supportedTargets,shareTo,shareStoryandinstalledTargetsall consult the registry. Call sites do not change when an add-on is added or removed.- Fix:
installedTargets()no longer letsMissingPluginExceptionorPlatformExceptionescape. Asking what is available should not itself need a try/catch; it now reports nothing installed, matching every other route.
0.1.0 #
First release.
Sharing to X, WhatsApp, Instagram (feed, Reels, direct, story), Facebook and
Facebook story, Messenger, Telegram, Threads, LinkedIn (feed and direct),
TikTok, SMS, mail, the system share sheet and the clipboard — text, links,
files, or a combination, through one shareTo call per target.
Notable decisions:
-
Capabilities are queryable.
SocialShareKit.capabilities()reports what a target accepts on the current platform — file counts, text ceilings, whether text is actually pre-filled or only copied to the clipboard, whether cancellation can be detected. Content is validated against it before any platform call, so an unsupported combination fails with an explanation instead of opening an app that quietly drops half the payload. -
No vendor SDKs. Sharing uses published URL schemes, Android intents and system composers only. There is no Facebook app id, client token or
AppDelegatewiring to add — except for the two story composers, which require an app id by design. The cost is thatfacebookandtiktokare unsupported on iOS, where a direct share genuinely needs their SDKs; both reportunsupportedPlatformand suggest the system sheet. -
Android needs no manifest changes. The
<queries>declarations and a namespacedFileProvidership in the plugin's manifest and merge into the host app. Without the<queries>block, every installed-app check returns false on Android 11 and above. -
Results, not exceptions. Every call completes with a
ShareResultcarrying aShareStatus. A missing app is an outcome, not an error.successmeans the composer opened, which is all any share API can honestly report. -
Text is left alone.
ShareText.stripHtmlandShareText.truncateForTargetare available but never applied automatically, sosnake_case,*and_survive in ordinary prose.