MPListenerController Class Reference
Inherits from | NSObject |
---|---|
Declared in | MPListenerController.h |
+ sharedInstance
Returns the shared instance object.
+ (instancetype)sharedInstance
Return Value
the Singleton instance of the MPListener class.
Discussion
Returns the shared instance object.
Declared In
MPListenerController.h
– addSdkListener:
Adds a listener to the SDK to receive any MPListenerProtocol calls from the API to that object
- (void)addSdkListener:(id<MPListenerProtocol>)sdkListener
Parameters
sdkListener |
An instance of a class that implements the MPListenerProtocol |
---|
Discussion
Adds a listener to the SDK to receive any MPListenerProtocol calls from the API to that object
Declared In
MPListenerController.h
– removeSdkListener:
Removes a listener from the SDK to no longer receive any MPListenerProtocol calls from the API to that object If you don’t remove the Listener we will retain a zombie reference of your object and it will never be released
- (void)removeSdkListener:(id<MPListenerProtocol>)sdkListener
Parameters
sdkListener |
An instance of a class that implements the MPListenerProtocol |
---|
Discussion
Removes a listener from the SDK to no longer receive any MPListenerProtocol calls from the API to that object If you don’t remove the Listener we will retain a zombie reference of your object and it will never be released
Declared In
MPListenerController.h
– onAPICalled:parameter1:parameter2:parameter3:parameter4:
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:(SEL)apiName parameter1:(nullable NSObject *)parameter1 parameter2:(nullable NSObject *)parameter2 parameter3:(nullable NSObject *)parameter3 parameter4:(nullable NSObject *)parameter4
Parameters
apiName |
the name of the API method |
---|---|
parameter1 |
to parameter4 are 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
MPListenerController.h
– onEntityStored:primaryKey:message:
Indicates that a new Database entry has been created
- (void)onEntityStored:(MPDatabaseTable)tableName primaryKey:(NSNumber *)primaryKey message:(NSString *)message
Parameters
tableName |
the name of the table |
---|---|
primaryKey |
a unique identifier for the database row |
message |
the database entry in JSON form |
Discussion
Indicates that a new Database entry has been created
Declared In
MPListenerController.h
– onNetworkRequestStarted:url:body:
Indicates that a Network Request has been started. Network Requests for a given Endpoint are performed synchronously, so the next invocation of onNetworkRequestFinished of the same Endpoint will be linked
- (void)onNetworkRequestStarted:(MPEndpoint)type url:(NSString *)url body:(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. Network Requests for a given Endpoint are performed synchronously, so the next invocation of onNetworkRequestFinished of the same Endpoint will be linked
Declared In
MPListenerController.h
– onNetworkRequestFinished:url:body:responseCode:
Indicates that a Network Request has completed.
- (void)onNetworkRequestFinished:(MPEndpoint)type url:(NSString *)url body:(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
MPListenerController.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:(NSString *)methodName kitId:(int)kitId used:(BOOL)used objects:(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
MPListenerController.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 com.mparticle.MParticle.ServiceProviders} |
---|
Discussion
Indicates that a Kit module, with kitId, has been included in the source files
Declared In
MPListenerController.h
– onKitConfigReceived:configuration:
Indicates that a Configuration for a kit with kitId is being applied
- (void)onKitConfigReceived:(int)kitId configuration:(NSDictionary *)configuration
Parameters
kitId |
the id of the kit, corresponds with a {@see com.mparticle.MParticle.ServiceProviders} |
---|---|
configuration |
the kit |
Discussion
Indicates that a Configuration for a kit with kitId is being applied
Declared In
MPListenerController.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 com.mparticle.MParticle.ServiceProviders} |
---|
Discussion
Indicates that a kit with kitId was successfully started
Declared In
MPListenerController.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 com.mparticle.consent.ConsentState} required it to be stopped, the Kit crashed, or a configuration was received that excluded the kit
- (void)onKitExcluded:(int)kitId reason:(NSString *)reason
Parameters
kitId |
the id of the kit, corresponds with a {@see com.mparticle.MParticle.ServiceProviders} |
---|---|
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 com.mparticle.consent.ConsentState} required it to be stopped, the Kit crashed, or a configuration was received that excluded the kit
Declared In
MPListenerController.h
– onSessionUpdated:
Indicates that state of a Session may have changed
- (void)onSessionUpdated:(nullable MParticleSession *)session
Parameters
session |
the current {@see InternalSession} instance |
---|
Discussion
Indicates that state of a Session may have changed
Declared In
MPListenerController.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
MPListenerController.h