{"id":28428563,"url":"https://github.com/coronalabs/framework-cloud","last_synced_at":"2025-10-10T03:32:15.318Z","repository":{"id":8008333,"uuid":"9416372","full_name":"coronalabs/framework-cloud","owner":"coronalabs","description":"The Core LUA Library for Corona Cloud","archived":false,"fork":false,"pushed_at":"2013-05-12T14:23:07.000Z","size":131,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-09-19T00:45:18.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coronalabs.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-13T16:21:23.000Z","updated_at":"2021-09-04T03:14:52.000Z","dependencies_parsed_at":"2022-09-05T18:23:32.857Z","dependency_job_id":null,"html_url":"https://github.com/coronalabs/framework-cloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coronalabs/framework-cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coronalabs%2Fframework-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coronalabs%2Fframework-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coronalabs%2Fframework-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coronalabs%2Fframework-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coronalabs","download_url":"https://codeload.github.com/coronalabs/framework-cloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coronalabs%2Fframework-cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002623,"owners_count":26083425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-05T12:38:40.582Z","updated_at":"2025-10-10T03:32:15.302Z","avatar_url":"https://github.com/coronalabs.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Corona Cloud Core Documentation\n\n## Overview\n\nWelcome to the core LUA library, a wrapper for all the available APIs in the Corona Cloud.\n\nThis is a new, improved version of the existing library. The main differences are:\n\n* replacing the Runtime listeners with listeners being passed to objects upon init\n* namespaces and object for each of the relevant aspects of a cloud application lifecycle.\n\n\n## Cloud objects\n\nThe main cloud object is responsible for initialisation, authentication and deallocation, as well as some lifecycle-related methods.\n\nThe leaderboards object is responsible for all the leaderboards-related operations.\n\nThe achievements object is responsible for all the achievements-related operations.\n\nThe analytics object takes care of submitting analytics events.\n\nThe chatRoom object creates and manages chat communication.\n\nThe friends object takes care of all the friend-related operations.\n\nThe news object is responsible for fetching news items.\n\nThe multiplayer object does handle all the pre-match operations. For match-related operations, \n\nThe match object will take care of managing flow while a game is active.\n\n## The main cloud object\n\nTo start, we will first require the library:\n\n```\nlocal cloud = require ( \"cloud\" )\n```\n\nalso, we will require json, because all the responses are raw, so we will have to decode them using json.decode:\n\n````\nlocal json = require( \"json\" )\n````\n\nif you want to see the request responses and various debug information in the console, set the instance variable cloud.debugEnabled to true:\n\n````\n-- set the debugEnabled variable\ncloud.debugEnabled = true\n````\n\nwhen calling the init method of the library, you pass in the listener you want to use for all the authentication-related events:\n\n````\n-- init the main cloud object\ncloud.init( \"YOUR_ACCESS_KEY\", \"YOUR_SECRET_KEY\", authListener )\n````\n\nwhere authListener is a function you declared earlier in your code. An example would be:\n\n````\n-- the authentication listener\nlocal authListener = function( event )\n        -- all events contain event.name, event.type, event.error, event.response.\n        if event.type == \"loggedIn\" then\n                --print( \"User is logged in: \", cloud.isLoggedIn )\n                -- get the user profile\n                cloud.getProfile()\n                -- get the chatrooms\n                chatRoom.getAll()\n                -- get all friends\n                friends.getAll()\n                -- get all news\n                news.getAll()\n                -- get the matches\n                multiplayer.getAllMatches()\n                --multiplayer.newMatch()\n                multiplayer.findMatch( \"516192d40fe8298269000006\" )\n        end\n        \n        if event.type == \"getProfile\" then\n                --print( \"The user profile: \", event.response )\n        end\n\nend\n````\n\n### Main cloud object methods, and the event they pass to the listener\n\n#### cloud.login( params )\n\nLogs an user in the cloud. params is a table containing the following records:\n\n- params.type (String, possible values: user, facebook or session)\n- params.email and params.password (String, relevant only when params.type is equal to \"user\")\n- params.facebookId (String, relevant only when params.type is equal to \"facebook\", contains the user Facebook ID)\n- params.accessToken (String, relevant only when params.type is equal to \"facebook\", contains the user's Facebook access token)\n- params.authToken(String, relevant only when the params.type is equal to \"session\", contains the authToken obtained after authenticating with the Corona Cloud) \n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"loggedIn\" for user authentication\n- event.type: \"facebookLoggedIn\" for Facebook authentication\n- event.type: \"sessionLoggedIn\" for session authentication (auth-token based)\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.getAuthToken()\n\nReturns the current authToken. Can be saved locally and used for future calls.\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\nNone.\n\n#### cloud.getProfile( [userId] )\n\nReturns the profile of an user. If the userId (String) parameter is omitted, then the currently logged in user's profile is returned, otherwise the user's corresponding to the userId parameter passed in.\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"getProfile\" when retrieving the user's own profile\n- event.type: \"getUserProfile\" when retrieving some other user's profile\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.updateProfile( params )\n\nUpdates the profile of an user with the values specified in the params table:\n\n- params.displayName - (String), the user's email address (username)\n- params.firstName - (String), the user's first name\n- params.lastName - (String), the user's last name\n- params.password - (String), the user's password\n- params.profilePicture- (String), the user's profile picture\n- params.facebookId - (String), the user's Facebook user id\n- params.facebookEnabled - (String), is the user's Facebook account connection enabled\n- params.facebookAccessToken - (String), the Facebook access token of the user\n- params.twitterEnabled - (String), is the user's Twitter account connection enabled\n- params.twitterEnabledToken - (String), the Twitter access token of the user\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"updateProfile\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.registerDevice( deviceToken )\n\nRegisters the device with the Corona Cloud for receiving push notifications.\n\ndeviceToken - (String), the device's token after registering for remote push notifications with Apple.\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"registerDevice\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.register( params )\n\nCreates an user account with the values specified in the params table:\n\n- params.displayName - (String), the user's username\n- params.firstName - (String), the user's first name\n- params.lastName - (String), the user's last name\n- params.password - (String), the user's password\n- params.email - (String), the user's email\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"registerUser\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.recoverPassword( email )\n\nSends a password reset link to the email address specified\n\nemail - (String) the email where the link should be sent\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"recoverPassword\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### cloud.getInfo()\n\nGets information about the current game from the Cloud API.\n\n##### \u003ci\u003eEvent passed to the authListener:\u003c/i\u003e\n\n- event.name: \"authentication\"\n- event.type: \"getInfo\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Instance variables of the main cloud object\n\n#### cloud.isLoggedIn\n\nBoolean, is true if the user is logged in\n\n### Leaderboards object methods, and the event they pass to the listener\n\n#### Localising the leaderboards object\n\n````\nlocal leaderboards = cloud.leaderboards\n````\n\n#### Assigning a listener to the leaderboards object\n\n````\nleaderboards.setListener( leaderboardsListener )\n````\nwhere leaderboardsListener is a previously declared function.\n\n#### leaderboards.getAll()\n\nGets a list of all the leaderboards defined for the game\n\n##### \u003ci\u003eEvent passed to the leaderboardsListener:\u003c/i\u003e\n\n- event.name: \"leaderboards\"\n- event.type: \"getAll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### leaderboards.getScores( leaderboardId )\n\nGets a list of the scores for the leaderboard leaderboardId\n\n- leaderboardId - (String) the leaderboard ID to retrieve scores for\n\n##### \u003ci\u003eEvent passed to the leaderboardsListener:\u003c/i\u003e\n\n- event.name: \"leaderboards\"\n- event.type: \"getScores\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### leaderboards.submitHighScore( leaderboardId, score )\n\nSubmits the score score to the leaderboard leaderboardId\n\n- leaderboardId - (String) the leaderboard ID to post the score on\n- score - (String) the score string, no dots or commas\n\n##### \u003ci\u003eEvent passed to the leaderboardsListener:\u003c/i\u003e\n\n- event.name: \"leaderboards\"\n- event.type: \"submitHighScore\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Achievement object methods, and the event they pass to the listener\n\n#### Localising the achievement object\n\n````\nlocal achievements = cloud.achievements\n````\n\n#### Assigning a listener to the achievements object\n\n````\nachievements.setListener( achievementsListener )\n````\nwhere achievementsListener is a previously declared function.\n\n#### achievements.getAll()\n\nGets a list of all the achievements defined for the game\n\n##### \u003ci\u003eEvent passed to the achievementsListener:\u003c/i\u003e\n\n- event.name: \"achievements\"\n- event.type: \"getAll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### achievements.getDetails( achievementId )\n\nGets the details of the achievement achievementId\n\n- achievementId - (String) the achievement ID to retrieve details for\n\n##### \u003ci\u003eEvent passed to the achievementsListener:\u003c/i\u003e\n\n- event.name: \"achievements\"\n- event.type: \"getDetails\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### achievements.getUnlocked()\n\nGets a list of all the unlocked achievements of the game\n\n##### \u003ci\u003eEvent passed to the achievementsListener:\u003c/i\u003e\n\n- event.name: \"achievements\"\n- event.type: \"getUnlocked\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### achievements.unlock( achievementId )\n\nUnlocks the achievement achievementId\n\n- achievementId - (String) the achievement ID to unlock\n\n##### \u003ci\u003eEvent passed to the achievementsListener:\u003c/i\u003e\n\n- event.name: \"achievements\"\n- event.type: \"unlock\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### achievements.update( achievementId, progress )\n\nUpdates the completion the achievement achievementId with the percentage progress\n\n- achievementId - (String) the achievement ID to update\n- progress - (String) the percentage achieved\n\n##### \u003ci\u003eEvent passed to the achievementsListener:\u003c/i\u003e\n\n- event.name: \"achievements\"\n- event.type: \"update\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Analytics object methods, and the event they pass to the listener\n\n#### Localising the analytics object\n\n````\nlocal analytics = cloud.analytics\n````\n\n#### Assigning a listener to the analytics object\n\n````\nanalytics.setListener( analyticsListener )\n````\nwhere analyticsListener is a previously declared function.\n\n#### analytics.submitEvent( params )\n\nSends a custom analytics event to the API.\n\nparams.event_type - (String) the event type (ex. \"session\")\nparams.message - (String) a message for the event (ex. \"John logged in\")\nparams.name - (String) the event name (ex. \"userLogin\")\n\n##### \u003ci\u003eEvent passed to the analyticsListener:\u003c/i\u003e\n\n- event.name: \"analytics\"\n- event.type: \"submitEvent\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### ChatRoom object methods, and the event they pass to the listener\n\n#### Localising the chatRoom object\n\n````\nlocal chatRoom = cloud.chatRoom\n````\n\n#### Assigning a listener to the chat object\n\n````\nchatRoom.setListener( chatListener )\n````\nwhere chatListener is a previously declared function.\n\n#### chatRoom.new( name )\n\nCreate a chatroom with the name name.\n\n- name - (String) the name of the chatroom to be created\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"create\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.delete( chatroomId )\n\nDelete the chatroom with the id chatroomId\n\n- chatroomId - (String) the id of the chatroom to be deleted\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"delete\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.sendMessage( chatroomId, message )\n\nSends the message message to the chatroom with the id chatroomId\n\n- chatroomId - (String) the id of the chatroom to post the message in\n- message - (String) the message to be sent\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"sendMessage\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.addUser( userID, chatroomId )\n\nAdds the user with the id userID to the chatroom with the id chatroomId\n\n- chatroomId - (String) the id of the chatroom to add the user to\n- userID - (String) the id of the user to be added\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"addUser\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.removeUser( userID, chatroomID )\n\nDeletes the user with the id userID from the chatroom with the id chatroomId\n\n- chatroomId - (String) the id of the chatroom to delete the user from\n- userID - (String) the id of the user to be added\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"removeUser\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.getAll()\n\nGet all the existing chatrooms \n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"getAll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.getHistory( chatroomID )\n\nRetrieves the list of chat messages from the chatroom with the id chatroomID\n\n- chatroomId - (String) the id of the chatroom to get the messages for\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"getHistory\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### chatRoom.getUsers( chatroomID )\n\nRetrieves the list of users present in the chatroom with the id chatroomID\n\n- chatroomId - (String) the id of the chatroom to get the users for\n\n##### \u003ci\u003eEvent passed to the chatListener:\u003c/i\u003e\n\n- event.name: \"chat\"\n- event.type: \"getUsers\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Friends object methods, and the event they pass to the listener\n\n#### Localising the friends object\n\n````\nlocal friends = cloud.friends\n````\n\n#### Assigning a listener to the friends object\n\n````\nfriends.setListener( friendsListener )\n````\nwhere friendsListener is a previously declared function.\n\n#### friends.getAll()\n\nRetrieve all the friends of the currently logged in user.\n\n##### \u003ci\u003eEvent passed to the friendsListener:\u003c/i\u003e\n\n- event.name: \"friends\"\n- event.type: \"getAll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### friends.add( friendID )\n\nAdd the user corresponding to friendID to the friend list.\n\n- friendID - (String) the userID of the user to be added as friend\n\n##### \u003ci\u003eEvent passed to the friendsListener:\u003c/i\u003e\n\n- event.name: \"friends\"\n- event.type: \"add\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### friends.remove( friendID )\n\nDelete the user corresponding to friendID from the friend list.\n\n- friendID - (String) the userID of the user to be deleted from the friends list\n\n##### \u003ci\u003eEvent passed to the friendsListener:\u003c/i\u003e\n\n- event.name: \"friends\"\n- event.type: \"remove\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### friends.find( keyword )\n\nSearch for users using the given keyword.\n\n- keyword - (String) the search keyword\n\n##### \u003ci\u003eEvent passed to the friendsListener:\u003c/i\u003e\n\n- event.name: \"friends\"\n- event.type: \"find\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### News object methods, and the event they pass to the listener\n\n#### Localising the news object\n\n````\nlocal news = cloud.news\n````\n\n#### Assigning a listener to the news object\n\n````\nnews.setListener( newsListener )\n````\nwhere newsListener is a previously declared function.\n\n#### news.getAll()\n\nRetrieve all the news defined in the Cloud Dashboard.\n\n##### \u003ci\u003eEvent passed to the newsListener:\u003c/i\u003e\n\n- event.name: \"news\"\n- event.type: \"getAll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### news.getAllUnread()\n\nRetrieve all the unread news items.\n\n##### \u003ci\u003eEvent passed to the newsListener:\u003c/i\u003e\n\n- event.name: \"news\"\n- event.type: \"getAllUnread\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### news.getDetails( articleID )\n\nRetrieve the full contents of the news item with the corresponding articleID.\n\n- articleID - (String) the article ID to be retrieved\n\n##### \u003ci\u003eEvent passed to the newsListener:\u003c/i\u003e\n\n- event.name: \"news\"\n- event.type: \"getDetails\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Multiplayer object methods, and the event they pass to the listener\n\n#### Localising the multiplayer object\n\n````\nlocal multiplayer = cloud.multiplayer\n````\n\n#### Assigning a listener to the multiplayer object\n\n````\nmultiplayer.setListener( multiplayerListener )\n````\nwhere multiplayerListener is a previously declared function.\n\n#### multiplayer.poll( userID )\n\nOpen channel for the user userID to receive multiplayer data.\n\n- userID - (String) the user ID the channel should be opened for.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"poll\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### multiplayer.getAllMatches()\n\nRetrieve the complete list of matches, in any state.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"getAllMatches\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### multiplayer.newMatch()\n\nCreates a new match.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"newMatch\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### \u003ci\u003eNote for multiplayer.newMatch()\n\nOn a successful call, the cloud match object (cloud.match) is automatically initialised, and the variable cloud.match.data is populated with the game information returned by the API. See below for the methods that can be used with the cloud.match object.\n\n#### multiplayer.findMatch( matchID )\n\nRetrieves the match specified by the matchID id.\n\n- matchID - (String) the match id to return information for.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"findMatch\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### \u003ci\u003eNote for multiplayer.findMatch()\n\nOn a successful call, the cloud match object (cloud.match) is automatically initialised, and the variable cloud.match.data is populated with the game information returned by the API. See below for the methods that can be used with the cloud.match object.\n\n#### multiplayer.deleteMatch( matchID )\n\nDeletes the match specified by the matchID id.\n\n- matchID - (String) the match id to return information for.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"deleteMatch\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### \u003ci\u003eNote for multiplayer.deleteMatch()\n\nOn a successful call, the cloud match object data (cloud.match.data) is automatically set to nil.\n\n#### multiplayer.addPlayerToGroup( userID, groupID, matchID )\n\nAdd the user specified by the userID to the group specified by the groupID, for the match matchID. Useful for operations like creating teams of players.\n\n- userID - (String) the user id to be added to the group\n- groupID - (String) the group id the user is added to\n- matchID - (String) the match id to operate on\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"addPlayerToGroup\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n### Match object methods, and the event they pass to the listener\n\n#### Localising the match object\n\n````\nlocal match = cloud.match\n````\n\n#### Assigning a listener to the match object\n\nThe match object sends events to the multiplayerListener, where multiplayerListener is a previously declared function.\n\n#### Note for the match methods\n\nAll the match methods don't use the dot notation. So please be sure you use match:resign instead of match.resign, same for all the match methods listed below.\n\n#### match:resign( userAlert )\n\nResigns the current match. If userAlert is set, the other players will receive a push notification.\n\n- userAlert - (String) the alert message to be contained in the push notification.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"resignMatch\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:start()\n\nStarts the match.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"start\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:stop()\n\nStops the match.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"stop\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:addPlayer( userID, userAlert )\n\nAdds the player specified by userID to the match. If userAlert is set, the user will receive a push notification.\n\n- userID - (String) the user id to add to the match\n- userAlert - (String) the alert message to be contained in the push notification.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"addPlayer\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:addRandomPlayer( userAlert )\n\nAdds a random player to the match. If userAlert is set, the user will receive a push notification.\n\n- userAlert - (String) the alert message to be contained in the push notification.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"addRandomPlayer\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:removePlayer( playerID )\n\nRemoves the player specified by playerID from the match.\n\n- playerID - (String) the id of the player that is to be removed.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"removePlayer\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:acceptChallenge( userAlert )\n\nSends a challenge accepted message for the current player. If userAlert is set, all the other players will receive a push notification.\n\n- userAlert - (String) the alert message to be contained in the push notification.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"acceptChallenge\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:declineChallenge()\n\nSends a challenge declined message for the current player. \n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"declineChallenge\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:submitMove( params )\n\nSends a move for the current match. The params table contains:\n\n- params.targetGroup - (String) the group the move should be submitted to (if omitted, the move is submitted to all users)\n- params.targetUser - (String) the user the move should be submitted to (if omitted, the move is submitted to all users)\n- params.userAlert - (String) the alert message to be contained in the push notification.\n- params.moveContent - (String) JSON encoded string with any number of records / information pieces\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"submitMove\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:getRecentMoves( [limit] )\n\nRetrieves the history of recent moves for the match.\n\n- limit (optional)(String) - the number of recent moves to retrieve.\n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"getRecentMoves\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.\n\n#### match:nudgeUser( userAlert, payLoad )\n\nNudges an inactive user. Matches become nudgeable once the active player has not submitted a move in more than 24h. Also, a user can only be nudged once every 24h. \n\n- userAlert - (String) the alert message to be contained in the push notification.\n- payLoad - (String) the payload to be added to the push notification. \n\n##### \u003ci\u003eEvent passed to the multiplayerListener:\u003c/i\u003e\n\n- event.name: \"multiplayer\"\n- event.type: \"nudgeUser\"\n- event.error: nil if no error occurred, string if error occurred.\n- event.response: nil if an error occurred, string if we received valid response.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoronalabs%2Fframework-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoronalabs%2Fframework-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoronalabs%2Fframework-cloud/lists"}