diff --git a/CHANGELOG.md b/CHANGELOG.md index 03f051d..5106d91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Add Samsung TV platform and Tizen Advertising ID support. + ## [2.7.0] - 2026-03-17 ### Added @@ -69,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't remove attributes when value is set to null +[Unreleased]: https://github.com/mParticle/mparticle-java-events-sdk/compare/v2.7.0...HEAD [2.7.0]: https://github.com/mParticle/mparticle-java-events-sdk/compare/v2.6.0...v2.7.0 [2.6.0]: https://github.com/mParticle/mparticle-java-events-sdk/compare/v2.5.4...v2.6.0 [2.5.4]: https://github.com/mParticle/mparticle-java-events-sdk/compare/v2.5.3...v2.5.4 diff --git a/src/main/java/com/mparticle/model/DeviceInformation.java b/src/main/java/com/mparticle/model/DeviceInformation.java index b33af64..1e696a7 100644 --- a/src/main/java/com/mparticle/model/DeviceInformation.java +++ b/src/main/java/com/mparticle/model/DeviceInformation.java @@ -57,7 +57,9 @@ public enum PlatformEnum { XBOX("xbox"), - FIRE_TV("FireTV"); + FIRE_TV("FireTV"), + + SAMSUNG_TV("samsung_tv"); private String value; @@ -281,6 +283,10 @@ public static ATTStatus fromValue(String value) { @SerializedName(SERIALIZED_NAME_FIRE_ADVERTISING_ID) private String fireAdvertisingId; + public static final String SERIALIZED_NAME_TIZEN_ADVERTISING_ID = "tizen_advertising_id"; + @SerializedName(SERIALIZED_NAME_TIZEN_ADVERTISING_ID) + private String tizenAdvertisingId; + public DeviceInformation brand(String brand) { this.brand = brand; return this; @@ -1136,6 +1142,25 @@ public void setFireAdvertisingId(String fireAdvertisingId) { this.fireAdvertisingId = fireAdvertisingId; } + public DeviceInformation tizenAdvertisingId(String tizenAdvertisingId) { + this.tizenAdvertisingId = tizenAdvertisingId; + return this; + } + + /** + * Get tizenAdvertisingId + * @return tizenAdvertisingId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getTizenAdvertisingId() { + return tizenAdvertisingId; + } + + public void setTizenAdvertisingId(String tizenAdvertisingId) { + this.tizenAdvertisingId = tizenAdvertisingId; + } + @Override public boolean equals(java.lang.Object o) { @@ -1190,12 +1215,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.rokuPublisherId, deviceInformation.rokuPublisherId) && Objects.equals(this.microsoftAdvertisingId, deviceInformation.microsoftAdvertisingId) && Objects.equals(this.microsoftPublisherId, deviceInformation.microsoftPublisherId) && - Objects.equals(this.fireAdvertisingId, deviceInformation.fireAdvertisingId); + Objects.equals(this.fireAdvertisingId, deviceInformation.fireAdvertisingId) && + Objects.equals(this.tizenAdvertisingId, deviceInformation.tizenAdvertisingId); } @Override public int hashCode() { - return Objects.hash(brand, product, device, androidUuid, deviceManufacturer, platform, osVersion, deviceModel, screenHeight, screenWidth, screenDpi, deviceCountry, localeLanguage, localeCountry, networkCountry, networkCarrier, networkCode, networkMobileCountryCode, timezoneOffset, buildIdentifier, httpHeaderUserAgent, iosAdvertisingId, pushToken, cpuArchitecture, isTablet, pushNotificationSoundEnabled, pushNotificationVibrateEnabled, radioAccessTechnology, supportsTelephony, hasNfc, bluetoothEnabled, bluetoothVersion, attTimestampUnixtimeMs, attAuthorizationStatus, iosIdfv, androidAdvertisingId, buildVersionRelease, limitAdTracking, ampId, isDst, rokuAdvertisingId, rokuPublisherId, microsoftAdvertisingId, microsoftPublisherId, fireAdvertisingId); + return Objects.hash(brand, product, device, androidUuid, deviceManufacturer, platform, osVersion, deviceModel, screenHeight, screenWidth, screenDpi, deviceCountry, localeLanguage, localeCountry, networkCountry, networkCarrier, networkCode, networkMobileCountryCode, timezoneOffset, buildIdentifier, httpHeaderUserAgent, iosAdvertisingId, pushToken, cpuArchitecture, isTablet, pushNotificationSoundEnabled, pushNotificationVibrateEnabled, radioAccessTechnology, supportsTelephony, hasNfc, bluetoothEnabled, bluetoothVersion, attTimestampUnixtimeMs, attAuthorizationStatus, iosIdfv, androidAdvertisingId, buildVersionRelease, limitAdTracking, ampId, isDst, rokuAdvertisingId, rokuPublisherId, microsoftAdvertisingId, microsoftPublisherId, fireAdvertisingId, tizenAdvertisingId); } @@ -1248,6 +1274,7 @@ public String toString() { sb.append(" microsoftAdvertisingId: ").append(toIndentedString(microsoftAdvertisingId)).append("\n"); sb.append(" microsoftPublisherId: ").append(toIndentedString(microsoftPublisherId)).append("\n"); sb.append(" fireAdvertisingId: ").append(toIndentedString(fireAdvertisingId)).append("\n"); + sb.append(" tizenAdvertisingId: ").append(toIndentedString(tizenAdvertisingId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/test/java/com/mparticle/client/EventsApiTest.java b/src/test/java/com/mparticle/client/EventsApiTest.java index eb3fdd3..121a63e 100644 --- a/src/test/java/com/mparticle/client/EventsApiTest.java +++ b/src/test/java/com/mparticle/client/EventsApiTest.java @@ -29,6 +29,25 @@ public void setup() { .createService(EventsApi.class); } + @Test + public void deviceInformationSupportsSamsungTvTizenAdvertisingId() { + String tizenAdvertisingId = "11111111-2222-3333-4444-555555555555"; + DeviceInformation deviceInformation = new DeviceInformation() + .platform(DeviceInformation.PlatformEnum.SAMSUNG_TV) + .tizenAdvertisingId(tizenAdvertisingId); + + Assert.assertEquals("samsung_tv", DeviceInformation.PlatformEnum.SAMSUNG_TV.getValue()); + Assert.assertEquals(DeviceInformation.PlatformEnum.SAMSUNG_TV, DeviceInformation.PlatformEnum.fromValue("samsung_tv")); + Assert.assertEquals(DeviceInformation.PlatformEnum.SAMSUNG_TV, deviceInformation.getPlatform()); + Assert.assertEquals(tizenAdvertisingId, deviceInformation.getTizenAdvertisingId()); + + Gson gson = new Gson(); + String json = gson.toJson(deviceInformation); + Assert.assertTrue(json.contains("\"tizen_advertising_id\":\"" + tizenAdvertisingId + "\"")); + DeviceInformation parsedDeviceInformation = gson.fromJson(json, DeviceInformation.class); + Assert.assertEquals(tizenAdvertisingId, parsedDeviceInformation.getTizenAdvertisingId()); + } + @Test public void logStringWtihLogger() { Logger.setLogHandler(new DefaultLogHandler());