A plugin for using native sharing functionality in Zebble application.
This plugin make you able to set clipboard and share something in an easy way on Android, iOS, and UWP platforms in Zebble Apps.
- Available on NuGet: https://www.nuget.org/packages/Zebble.Sharing/
- Install in your platform client projects.
- Available for iOS, Android and UWP.
Call Zebble.Device.Sharing
from any project to gain access to APIs.
The following code will open a dialog allowing the user to select a media to share some text or URL.
await Zebble.Device.Sharing.Share(text: "My Message", title: "My Title", url: "http://example.com");
// Note: You should provide at least one of the parameters.
For example, you can call it in the event handler of a button reading "Share".
The following code allows you to copy some text into clipboard:
await Device.Sharing.SetClipboard("some text");
Android allows you to specify a label for the clipboard as well. If you want to use that feature then you can use the following overload:
await Device.Sharing.SetClipboard("some text", "android specific label");
// Note: the label will be ignored in iOS and Windows platforms.
Method | Return Type | Parameters | Android | iOS | Windows |
---|---|---|---|---|---|
Share | Task<bool> | text -> string title -> string url -> string androidChooserTitle -> string iosExclude -> DeviceSharingOption errorAction -> OnError |
x | x | x |
SetClipboard | Task<bool> | text -> string errorAction -> OnError |
x | x | x |
SupportsClipboard | Task<bool> | errorAction -> OnError | x | x | x |