Get subscription data

  • Since SDK: 20

Get library state information for the subscriptions available in the library.

adobe.dps.store.getSubscriptionData

Parameter Type Description
callback

getSubscriptionDataFunction

Function to receive the list of subscriptions. each subscription has these properties; productId, title, duration, price, owned, active where productId is the store product identifier title is the formatted title of the subscription duration is the formatted duration of the subscription (eg. 3 Months, 1 Week etc) price is a localized string representing the price of the folio owned is a boolean signifying that this subscription has been owned by the user active is a boolean signifying that this subscription is currently active NOTE: If no current or cached information is available, the function will return an empty list

getSubscriptionDataFunction

Parameter Type Description
subscriptions

subscriptionArray

A list containing the library state information for the subscriptions available in the library.
subscription

subscription

A list of subscriptions.
productId

string

The store product identifier.
title

string

The formatted title of the subscription.
duration

string

The formatted duration of the subscription (such as "3 Months", "1 Week").
price

string

A localized string representing the price of the folio.
owned

boolean

True if this subscription has been owned by the user.
active

boolean

True if this subscription is currently active.

API Snippet

getSubscriptionData

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><%= wadl_file.awsi.name %> API</title>
<script type="text/javascript">
window.onadobedpscontextloaded = loadPage;
function loadPage()
{
  // call into the getSubscriptionData API
  if (window.onadobedpscontextloaded)
  {
    adobe.dps.store.getSubscriptionData(function(data)
      {
        for (subscription in data)
        {
          if (subscription.active)
            alert('Active Subscription: ' + subscription.title);
        }
      }
    );
  }
}
</script>
</head>

<body>
</body>
</html>