Corona setup

This guide will walk you through a step-by-step process to set up a basic Corona project using the Gamedonia Backend Platform.

Get the iOS Gamedonia SDK

Log in to Gamedonia and get the SDK at the Download Area. We recommend checking the SDK version, as we're regularly updating them.

Integrate game with backend

Create a Game in Gamedonia

We need to create a game in the Gamedonia Dashboard to be able to continue. The Dashboard is the developer tool that will allow you to manage all the related modules of the game. Now let's see how we can create a game.

  1. Click the Add New Game button.

  2. Write the name of your new game, select the platform and press Save when ready, your game will be created inmediately and will be ready to start communicating with your game client.

Configure the Corona Project

  1. Add an entry into a plugins table of your build.settings.

  2. settings =
    {
        plugins =
        {
            ["plugin.gamedonia"] =
            {
                publisherId = "com.gamedonia",
            },
        },      
    }
  3. We recomend that you use a global variable and declare it in main.lua:

  4. Gamedonia = require "plugin.gamedonia"
  5. Next, initialize the plugin with your Api Key and Secret.

  6. Gamedonia.initialize("d6e483d4-6938-45d0-8b51-8af30ee3f551", "8ad6c20b01665be1236160d57cbba4e8", "http://api.gamedonia.com", "v1")

 

When developing your app for the App Store or Google Play or whatever public market you should use the normal key that will respect all the security policies defined in your app. Use this as your default.

The master key lets you override permissions and access all entities and collections in the game, ignoring their Read/Write permissions.

User Authentication

Now your app is ready to perform calls to Gamedonia Backend!

You may be wondering what could be the first thing to do now that you have access to your own game backend. Why not create a User and log him in? You will need a logged in user (valid Gamedonia session) to invoke most of the Gamedonia API calls.

Create your first user

We will start with an easy example, where we create a user with email credentials ( email and password ). Here's how to create a user with Corona.

Login a user

The call to log in a user is the one that gets you a session token and, with it, the authentication to perform the rest of the API calls of the Gamedonia API. The credentials must be the ones of a created user at the Users collection. See how to log in a user with Corona.