AMAAppMetricaReporting protocol
- Instance methods
- Properties
- Method descriptions
- -clearAppEnvironment
- -pauseSession
- -reportAdRevenue:onFailure:
- -reportECommerce:onFailure
- -reportEvent:onFailure
- -reportEvent:parameters:onFailure
- -reportRevenue:onFailure:
- -reportUserProfile:onFailure
- -resumeSession
- -sendEventsBuffer
- -setAppEnvironmentValue:forKey:
- -setDataSendingEnabled:
- -setupWebViewReporting:onFailure:
- Property descriptions
Instance methods
Deleting all key-value data associated with all future events. |
|
Pauses the session. |
|
Sends information about advertising revenue to the AppMetrica server. |
|
Sends a message about an E-commerce event. |
|
Sends a custom event message. |
|
Sends a custom event message with additional parameters. |
|
Sends information about the purchase to the AppMetrica server. |
|
Sends information about a user profile update. |
|
Resumes the session or creates a new one if the session timeout has expired. |
|
Sends stored events from the buffer. |
|
Sets a key-value pair associated with all future events. |
|
Enables/disables sending statistics to the AppMetrica server. |
|
Adds a JavaScript interface with the AppMetrica name in a window to the specified webview. This lets you send client events from JavaScript code. |
Properties
Sets the ID of the user profile. |
Method descriptions
-clearAppEnvironment
- (void)clearAppEnvironment;
Cleaning the app environment, such as deleting all key-value data associated with all future events.
-pauseSession
- (void)pauseSession;
Pauses the user session.
-reportAdRevenue:onFailure:
- (void)reportAdRevenue:(AMAAdRevenueInfo *)adRevenue
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends information about advertising revenue to the AppMetrica server.
Parameters:
|
The instance of the AMAAdRevenueInfo class which contains information about advertising revenue. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-reportECommerce:onFailure
- (void)reportECommerce:(AMAECommerce *)eCommerce
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends a message about an E-commerce event.
Parameters:
|
The AMAECommerce class instance. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-reportEvent:onFailure
- (void)reportEvent:(NSString *)name
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends a custom event message.
Parameters:
|
Short name or description of the event. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-reportEvent:parameters:onFailure
- (void)reportEvent:(NSString *)name
parameters:(nullable NSDictionary *)params
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends a custom event message with additional parameters.
Parameters:
|
Short name or description of the event. |
|
Parameters as key-value pairs. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-reportRevenue:onFailure:
- (void)reportRevenue:(AMARevenueInfo *)revenueInfo
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends information about the purchase to the AppMetrica server.
Parameters:
|
The instance of the AMARevenueInfo class which contains information about a purchase. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-reportUserProfile:onFailure
- (void)reportUserProfile:(AMAUserProfile *)userProfile
onFailure:(nullable void (^)(NSError *error))onFailure;
Sends information about the user profile update to the AppMetrica server.
Parameters:
|
The instance of the AMAUserProfile class which contains information about the user profile. |
|
The block that is executed when an error occurs. The error is passed as a block argument. |
-resumeSession
- (void)resumeSession;
Resumes the session, or creates a new one if the session timeout has expired.
-sendEventsBuffer
- (void)sendEventsBuffer;
Sends stored events from the buffer.
AppMetrica SDK does not send an event immediately after it occurred. The library stores event data in the buffer. The +sendEventsBuffer
method sends data from the buffer and flushes it. Use the method to force sending stored events after passing important checkpoints of user scenarios.
Alert
Frequent use of the method can lead to increased outgoing internet traffic and energy consumption.
-setAppEnvironmentValue:forKey:
- (void)setAppEnvironmentValue:(nullable NSString *)value
forKey:(NSString *)key;
Setting key-value data to be used as additional information associated with all future events.
If the value is zero, the previously set key value is deleted. Nothing is done if the key wasn't added.
Parameters:
|
Value. |
|
Key. |
-setDataSendingEnabled:
- (void)setDataSendingEnabled:(BOOL)enabled;
Enables/disables sending statistics to the AppMetrica server.
Note
Disable sending statistics to the reporter does not affect the sending of data from the main API key. But disabling data sending for the main API key stops sending statistics from all reporters.
Parameters:
|
A flag indicating that sending statistics is enabled. The default value is
|
-setupWebViewReporting:onFailure:
- (void)setupWebViewReporting:(id<AMAJSControlling>)controller
onFailure:(nullable void (^)(NSError *error))onFailure;
Adds a JavaScript interface with the AppMetrica name in a window to the specified webview. This lets you send client events from JavaScript code.
Notes:
- The method must be called from the main queue.
- The method is not available on tvOS.
- Call this method before loading any content. We recommend calling this method before creating a webview and before adding your scripts to WKUserContentController. For more information, see Usage examples.
Parameters:
|
The |
|
A callback method to be called in the event of an error. |
Property descriptions
userProfileID
@property (class, nonatomic, nullable) NSString *userProfileID;
Sets the ID of the user profile. AppMetrica doesn't display predefined attributes
in the web interface if ProfieId sending isn't configured.