Track Player Events

Start sending your players' events on your platform to Gameball.
Start sending your players' events on your app or platform to Gameball, along with any metadata that describes the event. Depending on your Gameball programs configuration, the player can be rewarded based on the sent events.
Every Track Event call records a single user action. We call these “events”. We recommend that you make your event names human-readable, so that everyone can know what they mean instantly.
Event metadata are extra pieces of information you can tie to events you track. They can be anything that will be useful while designing your program.
Tracked events can be app events or server side events depending on how you would like to design your programs. App events can be sent to Gameball via the methods available in the SDK below. For server side events you can use Track Events API.
For more information about events and usage examples, check Tracking Player Events tutorial
To send Player events from your app to Gameball, you can use the sendActionWithMetaData or sendActionWithOutMetaData SDK methods. Each is used in a seperate case where sendActionWithMetaData is used if the tracked event has metadata attributes and sendActionWithOutMetaData is used if the tracked event has no metadata.

Send Event With Metadata

self.gameballApp?.
sendActionWithMetaData(events: [String : [String : Any]], completion: { (responseMessage, error) in
}))
Example
//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")
}
})

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")
}
})