MPListenerProtocol Protocol Reference

Conforms to NSObject
Declared in MPListenerProtocol.h

– onAPICalled:stackTrace:isExternal:objects:

Indicates that an API method was called. This includes invocations both from external sources (your code) and those which originated from within the SDK

- (void)onAPICalled:(nonnull NSString *)apiName stackTrace:(nonnull NSArray *)stackTrace isExternal:(BOOL)isExternal objects:(nullable NSArray *)objects

Parameters

apiName

the name of the API method

stackTrace

is the current stackTrace as an array of NSStrings

isExternal

true, if the call originated from outside of the SDK

objects

is the arguments sent to this api, such as the MPEvent in logEvent

Discussion

Indicates that an API method was called. This includes invocations both from external sources (your code) and those which originated from within the SDK

Declared In

MPListenerProtocol.h

– onEntityStored:primaryKey:message:

Indicates that a new Database entry has been created

- (void)onEntityStored:(MPDatabaseTable)tableName primaryKey:(nonnull NSNumber *)primaryKey message:(nonnull NSString *)message

Parameters

tableName

the name of the table

primaryKey

a unique identifier for the database row

message

the database entry in NSString form

Discussion

Indicates that a new Database entry has been created

Declared In

MPListenerProtocol.h

– onNetworkRequestStarted:url:body:

Indicates that a Network Request has been started.

- (void)onNetworkRequestStarted:(MPEndpoint)type url:(nonnull NSString *)url body:(nonnull NSObject *)body

Parameters

type

the type of network request, see Endpoint

url

the URL of the request

body

the response body in JSON form

Discussion

Indicates that a Network Request has been started.

Declared In

MPListenerProtocol.h

– onNetworkRequestFinished:url:body:responseCode:

Indicates that a Network Request has completed.

- (void)onNetworkRequestFinished:(MPEndpoint)type url:(nonnull NSString *)url body:(nonnull NSObject *)body responseCode:(NSInteger)responseCode

Parameters

type

the type of network request, see Endpoint

url

the URL of the request

body

the response body in JSON form

responseCode

the HTTP response code

Discussion

Indicates that a Network Request has completed.

Declared In

MPListenerProtocol.h

– onKitApiCalled:kitId:used:objects:

Indicates that a Kit’s API method has been invoked and that the name of the Kit’s method is different than the method containing this method’s invocation

- (void)onKitApiCalled:(nonnull NSString *)methodName kitId:(int)kitId used:(BOOL)used objects:(nonnull NSArray *)objects

Parameters

methodName

the name of the Kit’s method being called

kitId

the Id of the kit

used

whether the Kit’s method returned ReportingMessages, or null if return type is void

objects

the arguments supplied to the Kit

Discussion

Indicates that a Kit’s API method has been invoked and that the name of the Kit’s method is different than the method containing this method’s invocation

Declared In

MPListenerProtocol.h

– onKitDetected:

Indicates that a Kit module, with kitId, has been included in the source files

- (void)onKitDetected:(int)kitId

Parameters

kitId

the id of the kit, corresponds with a {@see MPKitInstance}

Discussion

Indicates that a Kit module, with kitId, has been included in the source files

Declared In

MPListenerProtocol.h

– onKitConfigReceived:configuration:

Indicates that a Configuration for a kit with kitId is being applied

- (void)onKitConfigReceived:(int)kitId configuration:(nonnull NSDictionary *)configuration

Parameters

kitId

the id of the kit, corresponds with a {@see MPKitInstance}

configuration

the kit

Discussion

Indicates that a Configuration for a kit with kitId is being applied

Declared In

MPListenerProtocol.h

– onKitStarted:

Indicates that a kit with kitId was successfully started

- (void)onKitStarted:(int)kitId

Parameters

kitId

the id of the kit, corresponds with a {@see MPKitInstance}

Discussion

Indicates that a kit with kitId was successfully started

Declared In

MPListenerProtocol.h

– onKitExcluded: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: {@see MParticleUser}’s loggedIn status or {@see MPConsentState} required it to be stopped, the Kit crashed, or a configuration was received that excluded the kit

- (void)onKitExcluded:(int)kitId reason:(nonnull NSString *)reason

Parameters

kitId

the id of the kit, corresponds with a {@see MPKitInstance}

reason

a message containing the reason a kit was stopped

Discussion

Indicates that either an attempt to start a kit was unsuccessful, or a started kit was stopped. Possibilities for why this may happen include: {@see MParticleUser}’s loggedIn status or {@see MPConsentState} required it to be stopped, the Kit crashed, or a configuration was received that excluded the kit

Declared In

MPListenerProtocol.h

– onSessionUpdated:

Indicates that state of a Session may have changed

- (void)onSessionUpdated:(nullable MParticleSession *)session

Parameters

session

the current {@see MParticleSession} instance

Discussion

Indicates that state of a Session may have changed

Declared In

MPListenerProtocol.h

– onAliasRequestFinished:

Indicates that an alias request has completed

- (void)onAliasRequestFinished:(nullable MPAliasResponse *)aliasResponse

Parameters

aliasResponse

the alias response object

Discussion

Indicates that an alias request has completed

Declared In

MPListenerProtocol.h