Package io.appmetrica.analytics
Class ModulesFacade
java.lang.Object
io.appmetrica.analytics.ModulesFacade
Class with methods for communication of different AppMetrica modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Attribution source "Adjust SDK" forreportExternalAttribution(int, String)
.static final int
Attribution source "Airbridge SDK" forreportExternalAttribution(int, String)
.static final int
Attribution source "Appsflyer SDK" forreportExternalAttribution(int, String)
.static final int
Attribution source "Kochava SDK" forreportExternalAttribution(int, String)
.static final int
Attribution source "Singular SDK" forreportExternalAttribution(int, String)
.static final int
Attribution source "Tenjin SDK" forreportExternalAttribution(int, String)
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IModuleReporter
getModuleReporter
(android.content.Context context, String apiKey) static boolean
static void
reportAdRevenue
(AdRevenue adRevenue) Reports auto collected adRevenue to AppMetricastatic void
reportEvent
(ModuleEvent moduleEvent) Reports custom event with various parameters.static void
reportExternalAttribution
(int source, String value) Reports attribution from external library.static void
Initiates forced sending of all stored events from the buffer.static void
setProxy
(io.appmetrica.analytics.impl.proxy.ModulesProxy proxy) Internal method for unit-tests.static void
setSessionExtra
(String key, byte[] value) Sets session extra.
-
Field Details
-
EXTERNAL_ATTRIBUTION_APPSFLYER
public static final int EXTERNAL_ATTRIBUTION_APPSFLYERAttribution source "Appsflyer SDK" forreportExternalAttribution(int, String)
.- See Also:
-
EXTERNAL_ATTRIBUTION_ADJUST
public static final int EXTERNAL_ATTRIBUTION_ADJUSTAttribution source "Adjust SDK" forreportExternalAttribution(int, String)
.- See Also:
-
EXTERNAL_ATTRIBUTION_KOCHAVA
public static final int EXTERNAL_ATTRIBUTION_KOCHAVAAttribution source "Kochava SDK" forreportExternalAttribution(int, String)
.- See Also:
-
EXTERNAL_ATTRIBUTION_TENJIN
public static final int EXTERNAL_ATTRIBUTION_TENJINAttribution source "Tenjin SDK" forreportExternalAttribution(int, String)
.- See Also:
-
EXTERNAL_ATTRIBUTION_AIRBRIDGE
public static final int EXTERNAL_ATTRIBUTION_AIRBRIDGEAttribution source "Airbridge SDK" forreportExternalAttribution(int, String)
.- See Also:
-
EXTERNAL_ATTRIBUTION_SINGULAR
public static final int EXTERNAL_ATTRIBUTION_SINGULARAttribution source "Singular SDK" forreportExternalAttribution(int, String)
.- See Also:
-
-
Constructor Details
-
ModulesFacade
public ModulesFacade()
-
-
Method Details
-
reportEvent
Reports custom event with various parameters.- Parameters:
moduleEvent
- Description of event to send.
-
setSessionExtra
Sets session extra. This data is stored on disk and used for every event even after application stop.- Parameters:
key
-String
keyvalue
- Value of extra
-
reportExternalAttribution
Reports attribution from external library.- Parameters:
source
- the SDK that provided the attribution. One ofEXTERNAL_ATTRIBUTION_APPSFLYER
,EXTERNAL_ATTRIBUTION_ADJUST
,EXTERNAL_ATTRIBUTION_KOCHAVA
,EXTERNAL_ATTRIBUTION_TENJIN
,EXTERNAL_ATTRIBUTION_AIRBRIDGE
,EXTERNAL_ATTRIBUTION_SINGULAR
value
- the attribution value.
-
isActivatedForApp
public static boolean isActivatedForApp()- Returns:
- true if AppMetrica is activated and false otherwise.
-
sendEventsBuffer
public static void sendEventsBuffer()Initiates forced sending of all stored events from the buffer. Sends all events even if the number of events is less thanAppMetricaConfig.maxReportsCount
. -
getModuleReporter
@NonNull public static IModuleReporter getModuleReporter(@NonNull android.content.Context context, @NonNull String apiKey) - Parameters:
context
- ContextapiKey
- API key of the required reporter- Returns:
IModuleReporter
for given API key
-
reportAdRevenue
Reports auto collected adRevenue to AppMetrica- Parameters:
adRevenue
- AdRevenue
-
setProxy
public static void setProxy(@NonNull io.appmetrica.analytics.impl.proxy.ModulesProxy proxy) Internal method for unit-tests.- Parameters:
proxy
- Proxy object
-