Skip to content
This library provide wrapper functions for Corona sdk that provide access to the baasbox REST API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
BaasBox.lua
LICENSE
README.md

README.md

baasbox-corona-lib-

This library provides wrapper functions for Corona SDK that provide access to the BaasBox REST API.

Samples

local baas = require( "BaasBox" )
-- ServerURL:PORT, ApplicationCode
baas.init("http://serverURL:9001", "1111111")

local callbackFunc = function(event)
-- TODO
end

baas.signUp("userName", "Pass", callbackFunc)
baas.logout(callbackFunc)<

local json = require ("json")
local data = {b=1}

baas.createDocument("CollectionName", data,
  function(event)
    baas.addRoleDocumentPermission("level", json.decode(event.response).data.id, "read", "registered",
       function(e)
          print("Permission done...")
       end)
  end)

local json = require ("json")
baas.getDocument("level", "625ff1cf-a0c0-414a-908e-280c79854d19",
  function(event)
    print(json.decode(event.response).result)
    print(json.decode(event.response).data.levelData.data)
  end)
You can’t perform that action at this time.