Share.share

From GiderosMobile
Revision as of 17:14, 20 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 share = require "Share"

local tex = Texture.new("gfx/cat.jpg")
local bmp = Bitmap.new(tex)
local rt = RenderTarget.new(tex:getWidth(), tex:getHeight())
rt:draw(bmp)
local buff = Buffer.new("cat.jpg")
rt:save("|B|cat.jpg")

local bdata = buff:get()

share.share("image/jpeg", bdata)