j3k0 / cordova-non-renewing-subscription

Simple API for Non-Renewing Subscriptions based on Fovea's Cordova Purchase Plugin
MIT License
19 stars 6 forks source link

Sample if user Subscriber #9

Closed okancelik34 closed 8 years ago

okancelik34 commented 8 years ago

are there any code sample if user subscriber do a function else do b function ? please share?

j3k0 commented 8 years ago

Use nonRenewing.getStatus(callback)...

As explained in the README, do something like this:

nonRenewing.getStatus(function(error, status) {
            if (error) {
                console.error("Failed to load subscription status: " + error);
                b();
            }
            else if (status.subscriber)
                a();
            else
                b();
});