Interface IIdentifiers
interface IIdentifiers
Extends com.amazon.apmf.IStandard
The IIdentifiers interface provides utilities for managing various identifiers and device-related metadata
in the context of an application and user persona. It includes functionality for generating, retrieving, and
managing unique identifiers such as UUIDs, User Agent strings, and friendly device names.
Methods
generateUuidV4()
com.amazon.apmf.Uuid generateUuidV4()
Generates a new UUID (version 4).
For custom identifiers.
Returns
com.amazon.apmf.Uuid
A new UUID.
getVendorTrackingId()
com.amazon.apmf.Uuid getVendorTrackingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Gets the tracking identifier UUID for the vendor signing the callers application.
The tracking identifier is resettable by the user and allows for tracking across all applications from a single vendor.
This identifier is available only with user opt-in.
Users are opted-in by default. However, they can chose to opt-out.
Returns
com.amazon.apmf.Uuid
A tracking identifier UUID if the user has opted in,
or a null UUID (0000-0000-0000-0000) if the user has opted out.
Throws
com.amazon.apmf.BaseError— For all errors.
enableVendorTrackingId()
void enableVendorTrackingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Enables the vendor tracking identifier for the current user if it was previously opted out.
This method has no effect if tracking is already enabled.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.tracking-id.modify.
Throws
com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For any other errors during the enabling process.
disableVendorTrackingId()
void disableVendorTrackingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Disables the vendor tracking identifier for the current user.
This method has no effect if tracking is already disabled.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.tracking-id.modify.
Throws
com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For any other errors during the disabling process.
getAdvertisingId()
com.amazon.apmf.Uuid getAdvertisingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Gets the advertising identifier for the current persona.
The advertising identifier is used for cross-app tracking and is resettable by the user.
This identifier is available only with user opt-in.
Returns
com.amazon.apmf.Uuid
A UUID representing the advertising ID if the user has opted in,
or a null UUID (0000-0000-0000-0000) if the user has opted out.
Throws
com.amazon.apmf.BaseError— For all errors.
enableAdvertisingId()
void enableAdvertisingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Enables advertising identifier support for a specified user while opting-in.
If not previously set, this method generates a new UUID for the advertising identifier.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.advertising-id.modify.
Throws
com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For all other errors.
disableAdvertisingId()
void disableAdvertisingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Disables advertising identifier support for a specified user.
This method has no effect if the advertising ID is already disabled.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.advertising-id.modify.
Throws
com.amazon.apmf.AccessDeniedError— If the caller does not have modify permissions to disable the Advertising Id.com.amazon.apmf.BaseError— For all other errors.
getUserAgent()
string getUserAgent()
Gets the User Agent string that is used to identify devices.
The User Agent string is profile dependent and contains information such as device model and OS version.
Example: “Amazon-TV/1.0 (<system-information>) <platform> (<platform-details>) <extensions>”.
The semantics of User Agent string could vary based on multiple factors.
Note: It is recommended to use the string value as it is and not rely on it for any kind of parsing.
Returns
string
A string representing the User Agent of the current device.
Throws
com.amazon.apmf.BaseError— For all errors.
getFriendlyDeviceName()
string getFriendlyDeviceName()
Gets the friendly name of the device for the current persona.
This name is shared across applications and can be modified by the user.
Returns one of:
- The user-customized device name if it exists and the caller has the “com.amazon.devconf.privilege.identifiers.device-friendly-name” run-time privilege
-
The device model name if either:
- No user-customized name has been set
- The caller lacks the required privilege
Returns
string
The friendly name of this device - either the user-customized name
(if set and privileged) or the device model name.
Throws
com.amazon.apmf.BaseError— For all errors.
setFriendlyDeviceName()
Sets a new friendly name for the device, applicable to the current persona.voidsetFriendlyDeviceName(stringname)
Parameters
name
string — Required
The new friendly name for the device. Must be 2 to 60 bytes in UTF-8 encoding.
This method requires the privilege: com.amazon.devconf.privilege.identifiers.device-friendly-name.write.
Throws
com.amazon.apmf.InvalidArgumentError— If the provided name doesn’t meet the specifications.com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For all other errors.
resetVendorTrackingId()
void resetVendorTrackingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Resets the vendor tracking identifier to a new UUID.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.tracking-id.modify.
Throws
com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For all other errors.
resetAdvertisingId()
void resetAdvertisingId()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError.
Resets the advertising identifier to a new UUID.
This method requires the privilege: com.amazon.kepler.identifiers.privilege.advertising-id.modify
Throws
com.amazon.apmf.AccessDeniedError— If the caller lacks the required privilege.com.amazon.apmf.BaseError— For all other errors.
addVendorTrackingIdListener()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError. Adds a listener for changes to the vendor tracking identifier.com.amazon.apmf.ISubscription*addVendorTrackingIdListener(IVendorTrackingIdListener*listener)
Parameters
listener
IVendorTrackingIdListener* — Required
The listener to be notified when the vendor tracking identifier changes.
Returns
com.amazon.apmf.ISubscription*
ISubscription object that can be used to unsubscribe from the event.
Throws
com.amazon.apmf.BaseError— For all errors.
addAdvertisingIdListener()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError. Adds a listener for changes to the advertising identifier.com.amazon.apmf.ISubscription*addAdvertisingIdListener(IAdvertisingIdListener*listener)
Parameters
listener
IAdvertisingIdListener* — Required
The listener to be notified when the advertising identifier changes.
Returns
com.amazon.apmf.ISubscription*
ISubscription object that can be used to unsubscribe from the event.
Throws
com.amazon.apmf.BaseError— For all errors.
addFriendlyDeviceNameListener()
Note: Currently not supported, throws exception apmf::iface::com::amazon::apmf::NotSupportedError. Adds a listener for changes to the friendly device name.com.amazon.apmf.ISubscription*addFriendlyDeviceNameListener(IFriendlyDeviceNameListener*listener)
Parameters
listener
IFriendlyDeviceNameListener* — Required
The listener to be notified when the friendly device name changes.
Returns
com.amazon.apmf.ISubscription*
ISubscription object that can be used to unsubscribe from the event.
Throws
com.amazon.apmf.BaseError— For all errors.

