Just further to this, it is possible to see if the license is active from the context, e.g.
AP.context.getContext(context => {
if (context.license && context.license.active) {
// Active trial | Active subscription | Cancelled subscription
} else {
// Unlicensed | Inactive trial | Inactive subscription
}
});
Cancelled subscription remains active license until the end of the billing period, at which point it reverts to Unlicensed