Share

About Share

Type: Gideros class
License: BSD License
Supported platforms:

       

Categories:
  • Social networking
  • User Interface

Gideros Share object provides a way to put share button for popular social portals in your Gideros app.

You can provide URL to your app website or market/appstore link and proposed title for your app users to share

Currently this class supports facebook and twitter. If you know or think that some other sharing service should be added to this class, let me know, and I'll add it. ;)

Package contains Share.lua and example Gideros application project.

Code example:

--initilize Share
local title = "AppcodingEasy.com - Put Share button in Gideros app"
local url = "http://appcodingeasy.com/Gideros-Mobile/Share-button-in-Gideros-app"
local sharer = Share.new(title, url)
 
--create holder for button
--for easier positioning
local holder = Sprite.new()
 
--get all buttons
local buttons = sharer:getAll()
 
--add buttons to holder
for i,button in pairs(buttons) do
    button:setPosition(0, holder:getHeight())
    holder:addChild(button)
end
 
--positione holder in center
local hmiddle = (application:getContentWidth()-holder:getWidth())/2
local vmiddle = (application:getContentHeight()-holder:getHeight())/2
holder:setPosition(hmiddle, vmiddle)
 
--add holder to stage
stage:addChild(holder)
				

Share video