Class Paywall
Shows the paywall of an offering as a form of its own.
Offering offering = CommerceManager.getInstance().getOfferings().getCurrent();
Paywall.show(offering, new PaywallListener() {
public void purchaseStarted(CommercePackage pkg) {
}
public void purchaseCompleted(CustomerInfo info) {
Dialog.show("Thanks", "Your purchase is active", "OK", null);
}
public void purchaseCancelled() {
}
public void restoreCompleted(CustomerInfo info) {
}
public void closed() {
}
});
-
Method Summary
Modifier and TypeMethodDescriptioncreateDefault(Offering offering) The built-in paywall document: a close button, a title, the packages of the offering as a list, a purchase button, a restore button and a footer.static PaywallViewshow(Offering offering, PaywallListener listener) Shows the paywall of the offering in a new form over the current one.
-
Method Details
-
show
Shows the paywall of the offering in a new form over the current one. Closing the paywall, or going back, returns to the form that was showing, and so does a purchase or a restore that completes: the paywall returns to that form first and the listener hears
purchaseCompletedorrestoreCompleted, thenclosed, over it. An offering with no paywall document is shown with the built-in one. The form's UIID isPaywallForm.Call on the EDT.
Parameters
-
offering: the offering to sell -
listener: told what happens on the paywall, or null
Returns
the view that was shown
-
-
createDefault
The built-in paywall document: a close button, a title, the packages of the offering as a list, a purchase button, a restore button and a footer. It names no colors, so the theme decides them all.
Parameters
offering: the offering the document is for; may be null
Returns
a new paywall document, which the caller may change
-