Skip to content

Commit

Permalink
Merge pull request #694 from praveek/dev
Browse files Browse the repository at this point in the history
[MOB-21093] Standardize event names
  • Loading branch information
praveek authored Jul 9, 2024
2 parents 8cb2378 + 44ee6ce commit c946c70
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,23 @@ internal object CoreConstants {
const val NONE = "N"
}
}

object EventNames {
const val ANALYTICS_TRACK = "Analytics Track"
const val COLLECT_PII = "Collect PII"
const val COLLECT_DATA = "Collect Data"
const val CONFIGURE_WITH_APP_ID = "Configure with App ID"
const val CONFIGURE_WITH_FILE_PATH = "Configure with File Path"
const val CLEAR_UPDATED_CONFIGURATION = "Clear Updated Configuration"
const val CONFIGURATION_REQUEST = "Configuration Request"
const val CONFIGURATION_RESPONSE = "Configuration Response"
const val CONFIGURATION_UPDATE = "Configuration Update"
const val GET_SDK_IDENTITIES = "Get SDK Identities"
const val LIFECYCLE_PAUSE = "Lifecycle Pause"
const val LIFECYCLE_RESUME = "Lifecycle Resume"
const val PRIVACY_STATUS_REQUEST = "Privacy Status Request"
const val SET_PUSH_IDENTIFIER = "Set Push Identifier"
const val SET_ADVERTISING_IDENTIFIER = "Set Advertising Identifier"
const val RESET_IDENTITIES_REQUEST = "Reset Identities Request"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ internal class ConfigurationExtension : Extension {
triggerEvent: Event? = null
) {
val builder = Event.Builder(
"Configuration Response Event",
CoreConstants.EventNames.CONFIGURATION_RESPONSE,
EventType.CONFIGURATION,
EventSource.RESPONSE_CONTENT
).setEventData(eventData)
Expand All @@ -509,7 +509,7 @@ internal class ConfigurationExtension : Extension {

private fun dispatchConfigurationRequest(eventData: Map<String, Any?>) {
val event = Event.Builder(
"Configure with AppID Internal",
CoreConstants.EventNames.CONFIGURATION_REQUEST,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT
)
Expand Down
43 changes: 26 additions & 17 deletions code/core/src/phone/java/com/adobe/marketing/mobile/MobileCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public static void setAdvertisingIdentifier(@Nullable final String advertisingId

Event event =
new Event.Builder(
"SetAdvertisingIdentifier",
CoreConstants.EventNames.SET_ADVERTISING_IDENTIFIER,
EventType.GENERIC_IDENTITY,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand All @@ -414,7 +414,7 @@ public static void setPushIdentifier(@Nullable final String pushIdentifier) {

Event event =
new Event.Builder(
"SetPushIdentifier",
CoreConstants.EventNames.SET_PUSH_IDENTIFIER,
EventType.GENERIC_IDENTITY,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand All @@ -440,7 +440,10 @@ public static void collectPii(@NonNull final Map<String, String> data) {
final Map<String, Object> eventData = new HashMap<>();
eventData.put(CoreConstants.EventDataKeys.Signal.SIGNAL_CONTEXT_DATA, data);
Event event =
new Event.Builder("CollectPII", EventType.GENERIC_PII, EventSource.REQUEST_CONTENT)
new Event.Builder(
CoreConstants.EventNames.COLLECT_PII,
EventType.GENERIC_PII,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
.build();
dispatchEvent(event);
Expand Down Expand Up @@ -474,7 +477,10 @@ public static void collectMessageInfo(@NonNull final Map<String, Object> message
}

Event event =
new Event.Builder("CollectData", EventType.GENERIC_DATA, EventSource.OS)
new Event.Builder(
CoreConstants.EventNames.COLLECT_DATA,
EventType.GENERIC_DATA,
EventSource.OS)
.setEventData(messageInfo)
.build();
dispatchEvent(event);
Expand Down Expand Up @@ -512,7 +518,10 @@ static void collectLaunchInfo(final Activity activity) {
}

Event event =
new Event.Builder("CollectData", EventType.GENERIC_DATA, EventSource.OS)
new Event.Builder(
CoreConstants.EventNames.COLLECT_DATA,
EventType.GENERIC_DATA,
EventSource.OS)
.setEventData(marshalledData)
.build();
dispatchEvent(event);
Expand Down Expand Up @@ -546,7 +555,7 @@ public static void configureWithAppID(@NonNull final String appId) {

Event event =
new Event.Builder(
"Configure with AppID",
CoreConstants.EventNames.CONFIGURE_WITH_APP_ID,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -590,7 +599,7 @@ public static void configureWithFileInAssets(@NonNull final String fileName) {

Event event =
new Event.Builder(
"Configure with FilePath",
CoreConstants.EventNames.CONFIGURE_WITH_FILE_PATH,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -633,7 +642,7 @@ public static void configureWithFileInPath(@NonNull final String filePath) {

Event event =
new Event.Builder(
"Configure with FilePath",
CoreConstants.EventNames.CONFIGURE_WITH_FILE_PATH,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -671,7 +680,7 @@ public static void updateConfiguration(@NonNull final Map<String, Object> config

Event event =
new Event.Builder(
"Configuration Update",
CoreConstants.EventNames.CONFIGURATION_UPDATE,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand All @@ -694,7 +703,7 @@ public static void clearUpdatedConfiguration() {

Event event =
new Event.Builder(
"Configuration Update",
CoreConstants.EventNames.CLEAR_UPDATED_CONFIGURATION,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -755,7 +764,7 @@ public static void getPrivacyStatus(final AdobeCallback<MobilePrivacyStatus> cal
true);
Event event =
new Event.Builder(
"PrivacyStatusRequest",
CoreConstants.EventNames.PRIVACY_STATUS_REQUEST,
EventType.CONFIGURATION,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -831,7 +840,7 @@ public void call(final Event event) {

Event event =
new Event.Builder(
"getSdkIdentities",
CoreConstants.EventNames.GET_SDK_IDENTITIES,
EventType.CONFIGURATION,
EventSource.REQUEST_IDENTITY)
.build();
Expand All @@ -844,7 +853,7 @@ public void call(final Event event) {
public static void resetIdentities() {
Event event =
new Event.Builder(
"Reset Identities Request",
CoreConstants.EventNames.RESET_IDENTITIES_REQUEST,
EventType.GENERIC_IDENTITY,
EventSource.REQUEST_RESET)
.build();
Expand Down Expand Up @@ -882,7 +891,7 @@ public static void lifecycleStart(@Nullable final Map<String, String> additional

Event event =
new Event.Builder(
"LifecycleResume",
CoreConstants.EventNames.LIFECYCLE_RESUME,
EventType.GENERIC_LIFECYCLE,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -913,7 +922,7 @@ public static void lifecyclePause() {

Event event =
new Event.Builder(
"LifecyclePause",
CoreConstants.EventNames.LIFECYCLE_PAUSE,
EventType.GENERIC_LIFECYCLE,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -947,7 +956,7 @@ public static void trackAction(
contextData == null ? new HashMap<String, String>() : contextData);
Event event =
new Event.Builder(
"Analytics Track",
CoreConstants.EventNames.ANALYTICS_TRACK,
EventType.GENERIC_TRACK,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down Expand Up @@ -978,7 +987,7 @@ public static void trackState(
contextData == null ? new HashMap<String, String>() : contextData);
Event event =
new Event.Builder(
"Analytics Track",
CoreConstants.EventNames.ANALYTICS_TRACK,
EventType.GENERIC_TRACK,
EventSource.REQUEST_CONTENT)
.setEventData(eventData)
Expand Down

0 comments on commit c946c70

Please sign in to comment.