accountLink.updateEntitlements()

Prev Next

accountLink.updateEntitlements()

Called whenever the X1 App is aware of a change in the user's subscription entitlements, or if it wants to reassert the list of subscription entitlements.

Signature:

$badger.accountLink().updateEntitlements([subscriptionEntitlements]);

Parameters:

Parameter Description Type Required?
appSettings An array of objects capturing subscription entitlements to packages of content which the user has subscribed to. The array contains the following fields:
id - identifier string for the entitlement (string, required)
startDate - epoch timestamp (in milliseconds) of when the entitlement goes into effect (date, optional)
endDate - epoch timestamp (in milliseconds) of when the entitlement is no longer valid (date, optional)
array no

Return Values:

None.

Usage Example:

$badger.accountLink().updateEntitlements([ 
    { "id": "Content1" },
    { "id": "contentTwo" },
    { "id": "Content 3" }
]);

Mandatory integration:

If your X1 App offers a signed-in experience and a user's entitlement status changes (by upgrading or downgrading their subscription, for example), you must send that information via the accountLink.updateEntitlements() method.