Send User Events to Gameball

Use our SDK to easily send your users event to Gameball to track user's progress and achievements.

You can send player events to Gameball through event API or through the SDK interfaces below.

The SDK provides wrappers to send an event to Gameball where the received event will be evaluated and counted toward player challenges achievement. There are two interfaces available as below to simplify integration

Send Event With Metadata

self.gameballApp?.
sendActionWithMetaData(events: [String : [String : Any]], completion: { (responseMessage, error) in
}))

Send Event Without Metadata

self.gameballApp?.
sendActionWithOutMetaData(events: [String : Any], completion: { (responseMessage, error) in
})

Example

//Send without Meta data
let eventsWithOutMetaData: [String : Any] = ["Buy": "Amount"]
self.gameballApp?.sendActionWithOutMetaData(events: eventsWithOutMetaData, completion: { (response, errorMsg) in
    DispatchQueue.main.async {
        self.showAlert(msg: response ?? "Falied to Send Action")

    }
})

//Send with Meta data
let eventsWithMetaData: [String : [String : Any]] = ["Buy": ["Amount":100,"Location":"Alex"]]
self.gameballApp?.sendActionWithMetaData(events: eventsWithMetaData , completion: { (response, errorMsg) in
    DispatchQueue.main.async {
        self.showAlert(msg: response ?? "Falied to Send Action")
    }
})

Refer to Events APIs in the API Reference section for more info.

Last updated