Manage user wishlist

In this section, we explain how to manage your users' wishlist with the SDK.

This feature is only available for your authenticated users. Please visit the authentication feature specification before trying to implement it

Feature specification

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
import { STWish } from "../../models/wish";
export interface ISTWishesSDK {
/**
* List wishes
*/
getWishes(): Promise<Array<STWish>>;
/**
* Create wish
* @param wishToCreate
*/
createWish(wishToCreate: STWish): Promise<STWish>;
/**
* Delete wish
* @param wishToDelete
*/
deleteWish(wishToDelete: STWish): Promise<number>;
}

The wishlist feature allows your users to emit wishes for some contents. It's a way to group wished contents in a list in order to buy them afterwards.

When a wished content is acquired using the transaction system, it will be automatically removed from the wish list.

Examples

List user wishes

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
const wishList = await staytunedSDK.STWishes.getWishes();

Create user wish

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
const createdWish = await staytunedSDK.STWishes.createWish({
contentKey: 'a-content-key', // Can be a content key
elementKey: 'an-element-key', // Or an element Key
});

A wish can be linked to a content OR an element but never both (will result in the wish to not be created)

Delete user wish

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
// Will return the number of deleted wish (1 | 0)
const deletedWishNumber = await staytunedSDK.STWishes.deleteWish({
id: 123, // A wish id
});