Permalink
Browse files

Adding in function for bringing up Post dialog

  • Loading branch information...
1 parent bb94e81 commit e1909bc7dd1e649788be2b0b2dd2f57d8d7b6a30 @GrahamRanson GrahamRanson committed Nov 8, 2012
Showing with 31 additions and 1 deletion.
  1. +21 −1 GGFacebook.lua
  2. +10 −0 README.md
View
@@ -143,7 +143,6 @@ function GGFacebook:sendRequest( message, to, title )
local params = {}
params.message = message or ""
params.title = title
- params.data = data
if to then
if type( to ) == "table" then
@@ -163,6 +162,27 @@ function GGFacebook:sendRequest( message, to, title )
end
+--- Make a post on a wall.
+-- @param link The link to send.
+-- @param picture The url to a picture to use for the link. Optional, by default one will be pulled from the link.
+-- @param name The name of the link. Optional, by default one will be pulled from the link.
+-- @param caption The caption of the link. Optional, by default one will be pulled from the link.
+-- @param description The description of the link. Optional, by default one will be pulled from the link.
+-- @param to The user id or username of the person whose wall wall this will be posted on. Optional, default is the current user.
+function GGFacebook:makePost( link, picture, name, caption, description, to )
+
+ local params = {}
+
+ params.to = to
+ params.link = link
+ params.picture = picture
+ params.name = name
+ params.description = description
+
+ self:showDialog( "feed", params )
+
+end
+
--- Checks if the user is logged in, only works if you're listener function doesn't block the internal one.
-- @return True if logged in, false otherwise.
function GGFacebook:isLoggedIn()
View
@@ -71,6 +71,16 @@ facebook:sendRequest( "Check out this game!", { "GrahamRanson", "SomeoneElse", "
facebook:sendRequest( "Check out this game!", nil, "Dialog Title" )
```
+##### Bring up a dialog to post on a wall. Only the link is required.
+```lua
+facebook:makePost( "http://www.glitchgames.co.uk", "link to a picture", "name", "caption", "description" )
+```
+
+##### Bring up a dialog to post on the wall of a specific user. Only the link and username is required.
+```lua
+facebook:makePost( "http://www.glitchgames.co.uk", "link to a picture", "name", "caption", "description", "GlitchGames" )
+```
+
##### Logout
```lua
facebook:logout()

0 comments on commit e1909bc

Please sign in to comment.