Difference between revisions of "Share"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
<!-- GIDEROSOBJ:Share -->
 
<!-- GIDEROSOBJ:Share -->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform winrt.png]]<br/>
'''<translate>Available since</translate>:''' 2020.7<br/>
+
'''Available since:''' Gideros 2020.7<br/>
  
 
=== Description ===
 
=== Description ===
Share a text or an image with other apps on iOS/Android.
+
Sharing a text or an image with other apps on '''iOS''', '''Android''' and '''Windows Uwp'''. This invokes the platform default sharing dialog, allowing to save, print, send, share, etc.
 +
 
 +
To use the '''Share''' plugin, add it to your project and call:
 +
<syntaxhighlight lang="lua">
 +
require "Share"
 +
</syntaxhighlight>
 +
 
 +
'''There are some more parameters for iOS, right click the plugin -> Properties'''
 +
 
 +
=== Example ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
Share=require "Share"
+
Share = require "Share"
  
Share.share("text/plain","Hello World!")
+
Share.share("text/plain", "Hello Gideros!")
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
=== References ===
 +
*'''https://android.googlesource.com/platform/external/mime-support/+/9817b71a54a2ee8b691c1dfa937c0f9b16b3473c/mime.types'''
  
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
[[Special:MyLanguage/Share.share|Share.share]] ''<translate>share some data</translate>''<br/><!-- GIDEROSMTD:Share.share(mimeType,data) shares data -->
+
[[Share.new]] ''creates a new Share object''<br/><!--GIDEROSMTD:Share.new() creates a new Share object-->
 +
[[Share.share]] ''shares data''<br/><!--GIDEROSMTD:Share.new(mimeType,data) shares data-->
 +
 
 +
[[Share:export]] ''exports data''<br/><!--GIDEROSMTD:Share.export(data,mimeType,filename) exports data-->
 +
[[Share:import]] ''imports data''<br/><!--GIDEROSMTD:Share.import(mimeType,extension) imports data-->
  
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Events</translate> ===
+
=== Events ===
=== <translate>Constants</translate> ===
+
[[Share_Event.SHARE_EXPORT_RESULT]]<br/><!--GIDEROSEVT:Event.SHARE_EXPORT_RESULT fileshareExportResult-->
 +
[[Share_Event.SHARE_IMPORT_RESULT]]<br/><!--GIDEROSEVT:Event.SHARE_IMPORT_RESULT fileshareImportResult-->
 +
=== Constants ===
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 21:17, 20 February 2025

Supported platforms: Platform android.pngPlatform ios.pngPlatform winrt.png
Available since: Gideros 2020.7

Description

Sharing a text or an image with other apps on iOS, Android and Windows Uwp. This invokes the platform default sharing dialog, allowing to save, print, send, share, etc.

To use the Share plugin, add it to your project and call:

require "Share"
There are some more parameters for iOS, right click the plugin -> Properties

Example

Share = require "Share"

Share.share("text/plain", "Hello Gideros!")

References

Methods

Share.new creates a new Share object
Share.share shares data

Share:export exports data
Share:import imports data

Events

Share_Event.SHARE_EXPORT_RESULT
Share_Event.SHARE_IMPORT_RESULT

Constants