Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
33 changes: 30 additions & 3 deletions src/main/java/com/mparticle/model/DeviceInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public enum PlatformEnum {

XBOX("xbox"),

FIRE_TV("FireTV");
FIRE_TV("FireTV"),

SAMSUNG_TV("samsung_tv");

private String value;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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();
}
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/com/mparticle/client/EventsApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Loading