Class: OptinDialog

OptinDialog


new OptinDialog(WonderPushSDK, options)

WonderPush Web SDK plugin to present the user an opt-in dialog before prompting her for push permission.

Parameters:
Name Type Description
WonderPushSDK external:WonderPushPluginSDK

The WonderPush SDK instance provided automatically on intanciation.

options OptinDialog.Options

The plugin options.

Methods


this.hideDialog()

Hides the dialog.

Fires:

this.showDialog()

Shows the dialog.

Fires:

Type Definitions


Options

Type:
  • Object
Properties:
Name Type Argument Default Description
triggers external:WonderPushPluginSDK.TriggersConfig <optional>

The triggers configuration for this plugin.

title string <optional>

The dialog title.

message string <optional>

The dialog message.

positiveButton string <optional>

The dialog positive button message.

negativeButton string <optional>

The dialog negative button message.

icon string <optional>

The dialog icon URL. Defaults to the default notification icon configured in the project.

style Object <optional>

Styles to be added to the dialog container.

closeSnooze number | boolean <optional>
false

How long to force to wait before presenting the dialog again, if the user clicks the close button. Use false to not set any extra snooze, true to never present again, or give a duration in milliseconds. Defaults to false, which relies on the SDK's default snooze of 12 hours without forcing extra snooze.

negativeSnooze number | boolean <optional>
604800000

How long to force to wait before presenting the dialog again, if the user clicks the close button. Use false to ignore, true to never present again, or give a duration in milliseconds. Defaults to 604800, 7 days.

positiveButtonBackgroundColor string <optional>

The hex color code of the positive button.

negativeButtonBackgroundColor string <optional>

The hex color code of the negative button.

positiveButtonTextColor string <optional>

The hex color code of the positive button.

negativeButtonTextColor string <optional>

The hex color code of the negative button.

backgroundColor string <optional>

The hex color code of the dialog background.

textColor string <optional>

The hex color code of the dialog text.

Events


event:"wonderpush-webplugin-optin-dialog.closeButton.click"

Close button click event.

This event bubbles and is cancelable.


event:"wonderpush-webplugin-optin-dialog.hide"

Hide event.

This event bubbles and is cancelable.


event:"wonderpush-webplugin-optin-dialog.negativeButton.click"

Negative button click event.

This event bubbles and is cancelable.


event:"wonderpush-webplugin-optin-dialog.positiveButton.click"

Positive button click event.

This event bubbles and is cancelable.


event:"wonderpush-webplugin-optin-dialog.show"

Show event.

This event bubbles and is cancelable.