public class Bastly<T> extends java.lang.Object implements WorkerLost
| Modifier and Type | Field and Description |
|---|---|
static int |
DATA_MESSAGE |
static int |
ORION_MESSAGE |
| Constructor and Description |
|---|
Bastly(java.lang.String userId,
java.lang.String apiKey,
android.app.Activity contextActivity,
java.lang.Class<T> messageClass)
Bastly constructor, you need to give all the parameters in order to work correctly.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onPause()
Info method to tell Bastly SDK that your current activity is on Paused status.
|
void |
onResume()
Info method to tell Bastly SDK that your current activity is on Resumed status.
|
void |
onWorkerDisconnected(Worker deadWorker) |
void |
registerChannel(java.lang.String channel)
Register to an specific channel that you want to listen to
|
void |
send(java.lang.String channel,
T message) |
void |
unResgiterChannel(java.lang.String channel)
Unregister an specific channel
|
public static final int ORION_MESSAGE
public static final int DATA_MESSAGE
public Bastly(java.lang.String userId,
java.lang.String apiKey,
android.app.Activity contextActivity,
java.lang.Class<T> messageClass)
userId - Your userId this is the id you will be recognized asapiKey - Your Bastly APIKEY it can be found on your account or in the registration emailcontextActivity - Current activity context, you should pass your courrent activity ContextmessageClass - Its the class that represents your data to be transfered, a model class.public void registerChannel(java.lang.String channel)
channel - a given string to listen to like "newsUpdates"public void unResgiterChannel(java.lang.String channel)
channel - Given channel id that you dont want to receive more comunications from.public void onResume()
public void onPause()
public void send(java.lang.String channel,
T message)
public void onWorkerDisconnected(Worker deadWorker)
onWorkerDisconnected in interface WorkerLost