public class ADM
extends java.lang.Object
Constructor and Description |
---|
ADM(android.content.Context context)
The entry point to ADM.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRegistrationId()
Obtains the current registration ID for this instance of your app.
|
boolean |
isSupported()
Indicates whether ADM is supported on the current device.
|
void |
startRegister()
Starts an asynchronous operation that registers your app for receiving ADM messages.
|
void |
startUnregister()
Starts an asynchronous operation that unregisters your app from receiving ADM messages.
|
void |
subscribeToTopic(java.lang.String topic)
Starts an asynchronous operation that subscribes your app to a topic for receiving
ADM messages related to the respective topic.
|
void |
unsubscribeFromTopic(java.lang.String topic)
Starts an asynchronous operation that unsubscribes your app from a topic to stop receiving
ADM messages related to the respective topic.
|
public ADM(android.content.Context context)
ADM
object and use each on
any thread.context
- The context for which to create an ADM
object.public boolean isSupported()
true
if ADM is present.public void startRegister()
ADMMessageHandlerBase
receives a ADMMessageHandlerBase.onRegistered(String)
callback when startRegister()
completes or an
ADMMessageHandlerBase.onRegistrationError(String)
callback if it fails.
Registration will fail unless an amazon user is signed in to the device.java.lang.IllegalStateException
- if ADM is not supported on the device.public void startUnregister()
ADMMessageHandlerBase
receives an ADMMessageHandlerBase.onUnregistered(String)
callback when startUnregister
completes or an
ADMMessageHandlerBase.onRegistrationError(String)
callback if it fails.java.lang.IllegalStateException
- if ADM is not supported on the device.public java.lang.String getRegistrationId()
null
if the current instance is not registered.java.lang.IllegalStateException
- if ADM is not supported on the device.public void subscribeToTopic(java.lang.String topic)
ADMMessageHandlerJobBase
receives a ADMMessageHandlerJobBase.onSubscribe(Context, String)
)}
callback when subscribeToTopic(String)
completes or an
ADMMessageHandlerJobBase.onSubscribeError(Context, String, String)
callback if it fails.
java.lang.IllegalStateException
- if ADM is not supported on the device.public void unsubscribeFromTopic(java.lang.String topic)
ADMMessageHandlerBase
receives a ADMMessageHandlerJobBase.onUnsubscribe(Context, String)
callback when unsubscribeFromTopic(String)
completes or an
ADMMessageHandlerJobBase.onUnsubscribeError(Context, String, String)
callback if it fails.
java.lang.IllegalStateException
- if ADM is not supported on the device.