Skip to main content

Events

PlayxUpdateEvents reports what happens to the update flow, mainly for analytics. Pass it in PlayxUpdateUIOptions:

PlayxUpdateUIOptions(
events: PlayxUpdateEvents(
onShown: (info) => analytics.log('update_shown', info.newVersion),
onUpdateTapped: (info) => analytics.log('update_tapped'),
onStoreOpenResult: (info, opened) => analytics.log('store_opened', opened),
onDismissed: (info, reason) => analytics.log('update_dismissed', reason.name),
onVersionSkipped: (info) => analytics.log('update_skipped'),
onSuppressed: (info, reason) => analytics.log('update_suppressed', reason.name),
),
)
EventWhen
onShownthe dialog or page is on screen (reported once, and only when something was really shown)
onUpdateTappedthe user tapped the update button
onStoreOpenResultthe store opened (true) or failed to (false) after the tap. Not reported when onUpdate handles the tap
onDismissedthe user closed it without updating. reason is button or system (back button or tapping outside)
onVersionSkippedthe user chose "Skip this version"
onSuppressedan update exists but the prompt was not shown because of "Later" or "Skip" (reason: snoozed or skippedVersion)
onInAppUpdateStarteda Google Play in-app update is about to start (Android)
onInAppUpdateResulta Google Play in-app update finished, with its result

Only the first outcome of a shown UI (update, skip or dismiss) is reported, so closing the dialog after tapping a button is not counted twice.

For showInAppUpdateDialog you can also pass events: directly, which also covers Android.

Errors in your callbacks​

An error thrown by a callback you pass (an event, onUpdate, onCancel or storeLauncher) is reported to FlutterError.onError and does not break the update flow: the dialog still closes and the "Later" choice is still saved.