Paywall action interceptor

This feature replaces both Login and Purchase interceptor with a more generic approach.

Starting with v3.0, Purchasely allow you to intercept and override every paywall action.

This can be used to:

  • paywallObserver mode: intercept purchase and restore actions to perform them using your own code or another SDK

  • Intercept the login button tapped to display your login form

  • Force the explicit acceptance of terms and conditions before a purchase

  • Intercept the call to a webview to inject credentials and be directly logged in

  • Block promo codes in Kids category apps to add a parental permission gate

  • Block direct access to external content (webview or link to Safari) in Kids category apps to add a parental permission gate

With the action interceptor, you get everything you need to:

  • Get the action (and context)

  • Display views, errors, messages, … above our paywalls

  • Choose if Purchasely should continue the action or not

You can intercept the following buttons being tapped:

  • Close

  • Login

  • Navigate (web or deeplink)

  • Purchase

  • Restore

  • Open another paywall

  • Promo code

Implementation

The interceptor passes 4 parameters:

  1. action, the PLYPresentationAction enum that gives the type of action

  2. parameters, a dictionary that contains the objects needed to perform the action (like a PLYPlan for a purchase)

  3. info, the PLYPresentationInfo object containing the controller of the paywall to dismiss it or display content / error messages above it, and the presentation id and content id associated to this paywall

  4. proceed a completion handler parameter with a boolean telling Purchasely if it should continue the action itself.

    i.e. : Returning true on a purchase action will lead Purchasely to trigger the purchase

Last updated

Was this helpful?