checkAppSubscription

Synopsis:

void blackberry.payment.checkAppSubscription(onSuccess, onFailure)

Arguments:

onSuccess {Function}

Function to be called on success.

subscriptionExists {Boolean}

Whether the subscription to the application is currently active.

onFailure {Function}

Function to be called when an error occurs.

error {PaymentError}

A PaymentError object containing details about the error.

Example:

<script type="text/javascript">

    function checkAppSubscription() {
        try {
            blackberry.payment.checkAppSubscription(onSuccess, onFailure);
        } catch (e){
            alert("Error" + e);
        }
    }

    function onSuccess(data) {
        alert("User is " + (data.subscriptionExists ? "" : "not ") + "subscribed to the app.");
    }

    function onFailure(error) {
        alert("Error occurred: " + error.errorText + ", " + error.errorID);
    }

</script>
            

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus