Called when the flow view reports an analytics event.
This is a notification: the return value follows the standard
close-on-true contract, but you normally keep the view open.
analytics event name
arbitrary event parameters
Called when a user navigates back on Android
Return true to close the flow view.
By default, this handler returns false, so the flow view stays open.
Called when the flow view appears
If you return true, the flow view will be closed.
Called when a user taps the close button on the flow view
If you return true, the flow view will be closed.
We strongly recommend to return true in this case.
Called when the flow view disappears
If you return true, the flow view will be closed.
Called when the flow view receives an error (e.g. it fails to render).
If you return true from this callback, the flow view will be closed.
AdaptyError object with error code and message
Called if a product list fails to load on a presented view, for example, if there is no internet connection
If you return true from this callback, the flow view will be closed.
AdaptyError object with error code and message
Called in observer mode when the user taps the purchase button inside an Adapty-rendered flow view. Adapty does NOT make the purchase — your app performs it through its own purchase API. Drive the flow view's loading state with the two provided callbacks:
onStartPurchase() right before you begin the purchase (shows the
flow view's loading indicator);onFinishPurchase() once it settles, success or failure (hides it).The return value follows the standard close-on-true contract; you
normally keep the view open (false) and dismiss it yourself after the
purchase succeeds.
product the user initiated the purchase for
notify the flow view the purchase started
notify the flow view the purchase finished
Fires only when the SDK was activated in observer mode
(activate(apiKey, { observerMode: true })). Without it, Adapty handles
purchases itself and this event is never emitted.
Adapty does not see the purchase you make, so after it succeeds you must
report the transaction to Adapty yourself (e.g. via reportTransaction). The
onStartPurchase/onFinishPurchase callbacks only drive the flow view's
loading UI;
Called in observer mode when the user taps the restore button inside an
Adapty-rendered flow view. Adapty does NOT restore — your app
performs it through its own API. Drive the flow view's loading state with the
two provided callbacks (onStartRestore() / onFinishRestore()).
notify the flow view the restore started
notify the flow view the restore finished
Fires only when the SDK was activated in observer mode
(activate(apiKey, { observerMode: true })). Without it, Adapty handles
restores itself and this event is never emitted.
Report any transactions surfaced by the restore to Adapty yourself (e.g.
via reportTransaction) so they flow into events and analytics. The
onStartRestore/onFinishRestore callbacks only drive the flow view's
loading UI; they do not report anything.
Called when a user taps the product in the flow view
If you return true from this callback, the flow view will be closed.
Called when the purchase succeeds, the user cancels their purchase, or the purchase appears to be pending
If you return true from this callback, the flow view will be closed.
We strongly recommend returning purchaseResult.type !== 'user_cancelled' in this case.
object, which provides details about the purchase.
If the result is 'success', it also includes the updated user's profile.
Called if a purchase fails after a user taps the purchase button
If you return true from this callback, the flow view will be closed.
AdaptyError object with error code and message
Called when a user taps the purchase button in the flow view
If you return true from this callback, the flow view will be closed.
Called when the flow view asks the host app to show the native
app review prompt (e.g. SKStoreReviewController on iOS,
In-App Review on Android).
This is a notification: returning true would close the view,
but for an app-review prompt you almost always want to keep it open.
Called when the flow view asks the host app to request an OS-level
permission (e.g. notifications, ATT). This is the only asynchronous
handler: return a Promise that resolves with the resulting status.
If you do not provide a handler, the SDK replies 'denied'.
permission identifier the flow view requested
arbitrary string args configured in the dashboard
Called when a restore is completed
If you return true from this callback, the flow view will be closed.
updated user profile
Called if a restore fails after a user taps the restore button
If you return true from this callback, the flow view will be closed.
AdaptyError object with error code and message
Called when a user taps the restore button in the flow view
If you return true from this callback, the flow view will be closed.
Called when the user taps a URL/link inside the paywall.
URL to open
How the URL was configured to open in the dashboard:
'browser_in_app' — in-app browser (e.g. WKWebView / Custom Tabs)
'browser_out_app' (default) — external browser (e.g. Linking.openURL)
Hashmap of possible events to their callbacks
See
[DOC] Handling View Events