default
API for adding and removing Recommendation2 objects on device.
RecommendationManager2 is a local recommendation service that handles the display and management of Recommendation2 objects submitted by client apps.
Extends
Constructors
new default()
new default():
default
Returns
Inherited from
Methods
addRecommendations()
static
addRecommendations(recommendations
):number
[]
Adds new recommendations on this device to be shown to user. The application has a predefined maximum limit for the number of recommendations it can hold concurrently. If this limit is surpassed, the system will delete older items based on their received timestamps
required privilege : "com.amazon.privilege.security.file-sharing"
Parameters
recommendations
Returns
number
[]
Inherited from
addRecommendations2()
static
addRecommendations2(recommendations
):number
[]
Adds new Recommendation2 objects to be displayed on the device.
The application has a predefined maximum limit of 20 concurrent recommendations, set by RecommendationManager. If this limit is exceeded, the system will delete older items based on their received timestamps. For recommendations using contentImageUri, the image will be downloaded asynchronously. If the image download fails, an error message is logged on the device and the recommendation is removed.
Parameters
recommendations
Array of Recommendation2 objects to add.
Returns
number
[]
Array of Uuids corresponding to added recommendations. Each Uuid corresponds to a recommendation and can be used for removing the recommendation in the future.
Privilege
"com.amazon.privilege.security.file-sharing"
Throws
SecurityError If calling the application does not have the required privilege.
Throws
InvalidArgumentError If any of these conditions occur: - Recommendation size exceeds 512KB - Mandatory fields are empty or invalid - Both contentImage
and contentImageUri
are missing - The provided contentImage
byte array doesn't meet size or dimension requirements - Recommendations array size is > 20
getMajorVersion()
static
getMajorVersion():number
Get the Major version of the underlying native module. This can be used to make version checks.
Returns
number
Overrides
getMinorVersion()
static
getMinorVersion():number
Get the Minor version of the underlying native module. This can be used to make version checks.
Returns
number
Overrides
getPatchVersion()
static
getPatchVersion():number
Get the patch version of the underlying native module. This can be used to make version checks.
Returns
number
Overrides
removeAllRecommendations()
static
removeAllRecommendations():void
Removes all the recommendations sent previously by this client.
Returns
void
Inherited from
default
.removeAllRecommendations
removeRecommendations()
static
removeRecommendations(ids
):void
Removes recommendations sent previously. Any recommendation id present for this client are removed, any ids not found are ignored.
Parameters
ids
number
[]
array that contains recommendation ids to be removed.
Returns
void
Inherited from
Last updated: Sep 30, 2025