Sandbox.Package/PackageInteraction Interaction { get; set; }

robot_2Generated
code_blocksInput

Description

The Interaction property of the Package class provides information about the authenticated user's interactions with a specific package. This property is only available client-side for certain users and is used to display details such as play history, favorite status, and whether the user has rated the item.

Usage

To access the Interaction property, you need to have an instance of the Package class. This property is particularly useful for client-side applications where you want to display user-specific information about a package.

Example

// Assuming 'package' is an instance of Sandbox.Package
var userInteraction = package.Interaction;

// Check if the package is a favorite
bool isFavorite = userInteraction.IsFavorite;

// Get the user's rating for the package
int userRating = userInteraction.UserRating;

// Display play history
var playHistory = userInteraction.PlayHistory;