{"__v":1,"_id":"570bdbe29ca0ae1700fdb582","category":{"project":"56abbf55f25f160d00e17f4e","version":"56abbf55f25f160d00e17f51","_id":"570a5676ade45d0e00c1ad33","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-10T13:34:46.864Z","from_sync":false,"order":3,"slug":"client-side-api","title":"Client Side API"},"parentDoc":null,"project":"56abbf55f25f160d00e17f4e","user":"56abbec30b9e0b0d00616274","version":{"__v":12,"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","createdAt":"2016-01-29T19:36:53.665Z","releaseDate":"2016-01-29T19:36:53.665Z","categories":["56abbf56f25f160d00e17f52","56abca6bf9757e0d007c6650","56acddfa0ab3c00d00ce3332","56af65da9d32e30d0006d30f","56af66cab34d210d003d9ad0","56af6afcd21e9c0d00b628d1","56af6d6ecc4cbd0d00ce2c88","5705b12221cfed0e00e8c580","570a5676ade45d0e00c1ad33","570d7d25d1e4b82000d9e385","570eac3c3160d10e0041df0e","575709000fd6a3200010dded"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-11T17:16:18.733Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":23,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note\",\n  \"body\": \"This feature will not function unless we have enabled it for your game. If you would like to have this feature enabled, please email us at [apps:::at:::kongregate.com](mailto:apps@kongregate.com)\"\n}\n[/block]\n## Feed Posts\n\nThis feature displays a dialog requesting permission to make a feed post to a player's wall on behalf of the game. If the player is not authenticated, it will require the player to authenticate before displaying the dialog.\n\nThe player may optionally allow all posts from your game. If the player choses to enable that feature, then this will automatically make a post on that player's wall without invoking the dialog.\n\nThe `showFeedPostBox` method takes a single argument, which can either be a string containing the text to place into the feed, or an object that contains properties defining the content, image, and parameters to be passed into the game.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`content`\",\n    \"0-1\": \"String or Object\",\n    \"0-2\": \"A string containing the text for the feed post, or an object with `content`, `image_uri`, and `kv_params` fields.\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"While the game is not published (in \\\"preview\\\" mode), the post will not actually show on the user's feed. This is to avoid confusion around games that aren't public sending out messages. As long as you get the pop-up friend selection box and confirmation the API is integrated correctly\"\n}\n[/block]\n### Making a Feed Post\n\nFeed posts are composed of two components: the <span style=\"font-style:italic\">content</span> of the feed post, and (optionally) an <span style=\"font-style:italic\">image URI</span> that you specify. If you do not specify an image URI, then the game's icon will be used instead.\n\n### Basic Feed Posts\n\nIf you don't need a custom image, you may invoke showFeedPostBox with a string containing the post content:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"kongregate.services.showFeedPostBox(\\\"Praise the Sun!\\\");\",\n      \"language\": \"haxe\",\n      \"name\": \"ActionScript 3\"\n    },\n    {\n      \"code\": \"kongregate.services.showFeedPostBox(\\\"Praise the Sun!\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n### Using a Custom Image and Parameters\n\nIf you wish to specify a custom image and parameters to be passed into the game when clicked, then you will need to pass in an object with the properties:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`content`\",\n    \"0-1\": \"String\",\n    \"0-2\": \"The text content for the feed post\",\n    \"1-0\": \"`image_uri`\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Link to an image to use as an icon for the feed post\",\n    \"2-0\": \"`kv_params`\",\n    \"2-1\": \"Object\",\n    \"2-2\": \"Optional parameters to be passed into the game when the feed post link is followed\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n*Example*: Complex feed post:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"kongregate.services.showFeedPostBox({\\n  content: \\\"Come help defeat the boss!\\\",\\n  image_uri: \\\"http://your-domain.tld/feed-post-images/really-hard-boss-face.png\\\",\\n  kv_params: { kv_promo_code: 12345 }\\n});\",\n      \"language\": \"haxe\",\n      \"name\": \"ActionScript 3\"\n    },\n    {\n      \"code\": \"kongregate.services.showFeedPostBox({\\n  content: \\\"Come help defeat the boss!\\\",\\n  image_uri: \\\"http://your-domain.tld/feed-post-images/really-hard-boss-face.png\\\",\\n  kv_params: { kv_promo_code: 12345 }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"JavaScript\"\n    }\n  ]\n}\n[/block]","excerpt":"Create a post in the user's activity feed\n`showFeedPostBox(content)`","slug":"client-api-services-showfeedpostbox","type":"fn","title":"Services.ShowFeedPostBox"}

fnServices.ShowFeedPostBox

Create a post in the user's activity feed `showFeedPostBox(content)`

[block:callout] { "type": "warning", "title": "Note", "body": "This feature will not function unless we have enabled it for your game. If you would like to have this feature enabled, please email us at [apps@kongregate.com](mailto:apps@kongregate.com)" } [/block] ## Feed Posts This feature displays a dialog requesting permission to make a feed post to a player's wall on behalf of the game. If the player is not authenticated, it will require the player to authenticate before displaying the dialog. The player may optionally allow all posts from your game. If the player choses to enable that feature, then this will automatically make a post on that player's wall without invoking the dialog. The `showFeedPostBox` method takes a single argument, which can either be a string containing the text to place into the feed, or an object that contains properties defining the content, image, and parameters to be passed into the game. [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`content`", "0-1": "String or Object", "0-2": "A string containing the text for the feed post, or an object with `content`, `image_uri`, and `kv_params` fields." }, "cols": 3, "rows": 1 } [/block] [block:callout] { "type": "info", "title": "Note", "body": "While the game is not published (in \"preview\" mode), the post will not actually show on the user's feed. This is to avoid confusion around games that aren't public sending out messages. As long as you get the pop-up friend selection box and confirmation the API is integrated correctly" } [/block] ### Making a Feed Post Feed posts are composed of two components: the <span style="font-style:italic">content</span> of the feed post, and (optionally) an <span style="font-style:italic">image URI</span> that you specify. If you do not specify an image URI, then the game's icon will be used instead. ### Basic Feed Posts If you don't need a custom image, you may invoke showFeedPostBox with a string containing the post content: [block:code] { "codes": [ { "code": "kongregate.services.showFeedPostBox(\"Praise the Sun!\");", "language": "haxe", "name": "ActionScript 3" }, { "code": "kongregate.services.showFeedPostBox(\"Praise the Sun!\");", "language": "javascript" } ] } [/block] ### Using a Custom Image and Parameters If you wish to specify a custom image and parameters to be passed into the game when clicked, then you will need to pass in an object with the properties: [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`content`", "0-1": "String", "0-2": "The text content for the feed post", "1-0": "`image_uri`", "1-1": "String", "1-2": "Link to an image to use as an icon for the feed post", "2-0": "`kv_params`", "2-1": "Object", "2-2": "Optional parameters to be passed into the game when the feed post link is followed" }, "cols": 3, "rows": 3 } [/block] *Example*: Complex feed post: [block:code] { "codes": [ { "code": "kongregate.services.showFeedPostBox({\n content: \"Come help defeat the boss!\",\n image_uri: \"http://your-domain.tld/feed-post-images/really-hard-boss-face.png\",\n kv_params: { kv_promo_code: 12345 }\n});", "language": "haxe", "name": "ActionScript 3" }, { "code": "kongregate.services.showFeedPostBox({\n content: \"Come help defeat the boss!\",\n image_uri: \"http://your-domain.tld/feed-post-images/really-hard-boss-face.png\",\n kv_params: { kv_promo_code: 12345 }\n});", "language": "javascript", "name": "JavaScript" } ] } [/block]