Package com.mparticle
Class SdkListener
- java.lang.Object
-
- com.mparticle.SdkListener
-
public class SdkListener extends java.lang.ObjectNote: This is an Experimental feature. Adding an instance of SdkListener will slow down the SDK and should be used only in development. SdkListener is a new feature which enables updates on and visibility into internal Events occuring inside the SDK.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSdkListener.DatabaseTablestatic classSdkListener.Endpoint
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringERROR_MESSAGE
-
Constructor Summary
Constructors Constructor Description SdkListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonAliasRequestFinished(AliasResponse aliasResponse)Callback forIdentityApi.aliasUsers(AliasRequest)results.voidonApiCalled(java.lang.String apiName, java.util.List<java.lang.Object> objects, boolean isExternal)Indicates that an API method was called.voidonEntityStored(SdkListener.DatabaseTable tableName, long primaryKey, org.json.JSONObject message)Indicates that a new Database entry has been created.voidonKitApiCalled(int kitId, java.lang.String apiName, java.lang.String invokingMethodName, java.lang.String kitManagerMethodName, java.util.List<java.lang.Object> objects, boolean used)Indicates that a Kit method was invoked.voidonKitConfigReceived(int kitId, org.json.JSONObject configuration)Indicates that a Configuration for a kit with kitId is being applied.voidonKitDetected(int kitId)Indicates that a Kit module, with kitId, is present in the classpath.voidonKitExcluded(int kitId, java.lang.String reason)Indicates that either an attempt to start a kit was unsuccessful, or a started kit was stopped.voidonKitStarted(int kitId)Indicates that a kit with kitId was successfully started.voidonNetworkRequestFinished(SdkListener.Endpoint type, java.lang.String url, org.json.JSONObject response, int responseCode)Indicates that a Network Request has completed.voidonNetworkRequestStarted(SdkListener.Endpoint type, java.lang.String url, org.json.JSONObject body)Indicates that a Network Request has been started.voidonSessionUpdated(com.mparticle.internal.InternalSession session)Indicates that state of a Session may have changed.
-
-
-
Field Detail
-
ERROR_MESSAGE
public static final java.lang.String ERROR_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
onApiCalled
public void onApiCalled(@NonNull java.lang.String apiName, @NonNull java.util.List<java.lang.Object> objects, boolean isExternal)Indicates that an API method was called. This includes invocations both from external sources (your code) and those which originated from within the SDK.- Parameters:
apiName- the name of the Api methodobjects- the arguments used in the invocationisExternal- true, if the call originated from outside of the SDK
-
onEntityStored
public void onEntityStored(@NonNull SdkListener.DatabaseTable tableName, @NonNull long primaryKey, @NonNull org.json.JSONObject message)Indicates that a new Database entry has been created.- Parameters:
tableName- the name of the table, seeSdkListener.DatabaseTableprimaryKey- a unique identifier for the database rowmessage- the database entry in JSON form
-
onNetworkRequestStarted
public void onNetworkRequestStarted(@NonNull SdkListener.Endpoint type, @NonNull java.lang.String url, @NonNull org.json.JSONObject body)Indicates that a Network Request has been started. Network Requests for a givenSdkListener.Endpointare performed. synchronously, so the next invocation ofonNetworkRequestStarted(Endpoint, String, JSONObject)of the sameSdkListener.Endpoint, will refer to the same request- Parameters:
type- the type of network request, seeSdkListener.Endpointurl- the URL of the requestbody- the response body in JSON form
-
onNetworkRequestFinished
public void onNetworkRequestFinished(@NonNull SdkListener.Endpoint type, @NonNull java.lang.String url, @Nullable org.json.JSONObject response, int responseCode)Indicates that a Network Request has completed. Network Requests for a givenSdkListener.Endpointare performed synchronously, so any invocation will refer to the same request as the most recent.onNetworkRequestStarted(Endpoint, String, JSONObject)invocation of the sameSdkListener.Endpoint- Parameters:
type- the type of network request, seeSdkListener.Endpointurl- the URL of the requestresponse- the response body in JSON formresponseCode- the HTTP response code
-
onKitApiCalled
public void onKitApiCalled(int kitId, @NonNull java.lang.String apiName, @Nullable java.lang.String invokingMethodName, @Nullable java.lang.String kitManagerMethodName, @NonNull java.util.List<java.lang.Object> objects, boolean used)Indicates that a Kit method was invoked.- Parameters:
kitId- the id of the kit, corresponds with aMParticle.ServiceProvidersapiName- the method name which was invokedinvokingMethodName- the SDK Api call which triggered the invocation, if there was onekitManagerMethodName- the KitManager call which serverd as the intermediate trigger of the invocation, if there was oneobjects- the arguments passedused- whether aReportingService.ReportingMessagewas generated as a result of the invocation.ReportingService.ReportingMessageindicate that an argument was consumed by the Kit
-
onKitDetected
public void onKitDetected(int kitId)
Indicates that a Kit module, with kitId, is present in the classpath.- Parameters:
kitId- the id of the kit, corresponse with aMParticle.ServiceProviders
-
onKitConfigReceived
public void onKitConfigReceived(int kitId, @NonNull org.json.JSONObject configuration)Indicates that a Configuration for a kit with kitId is being applied.- Parameters:
kitId- the id of the kit, corresponse with aMParticle.ServiceProvidersconfiguration- the configuration in JSON form
-
onKitStarted
public void onKitStarted(int kitId)
Indicates that a kit with kitId was successfully started.- Parameters:
kitId- the id of the kit, corresponse with aMParticle.ServiceProviders
-
onKitExcluded
public void onKitExcluded(int kitId, @NonNull java.lang.String reason)Indicates that either an attempt to start a kit was unsuccessful, or a started kit was stopped. Possibilities for why this may happen include:MParticleUser's loggedIn status orConsentStaterequired it to be stopped, the Kit crashed, or a configuration was received with excluded the kit.- Parameters:
kitId- the id of the kit, corresponse with aMParticle.ServiceProvidersreason- a message containing the reason a kit was stopped
-
onSessionUpdated
public void onSessionUpdated(@Nullable com.mparticle.internal.InternalSession session)Indicates that state of a Session may have changed.- Parameters:
session- the currentInternalSessioninstance
-
onAliasRequestFinished
public void onAliasRequestFinished(AliasResponse aliasResponse)
Callback forIdentityApi.aliasUsers(AliasRequest)results.- Parameters:
aliasResponse-
-
-