Share.share

From GiderosMobile
Revision as of 18:29, 18 February 2025 by MoKaLux (talk | contribs)

Available since: Gideros 2020.7
Class: Share

Description

Sharing a piece of data with an external app.

Share.share(mimeType,data)

This invokes the platform default sharing dialog, allowing to save, print, send, share, etc.

Supported MIME types:

  • "text/*"
  • "image/png"
  • "image/jpeg"

Parameters

mimeType: (string) the MIME type of the data
data: (string) the data itself

Example

local b = Buffer.new("diploma.jpg")
rt:save("|B|diploma.jpg")
local bdata = b:get()
b = nil
collectgarbage()
print("DIPLOMA:", #bdata)
local ok, share = pcall(function() return require "Share" end)
if ok then
--	Analytics("diploma_share")
	share.share("image/jpeg", bdata)
end