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 triggersexternal:WonderPushPluginSDK.TriggersConfig <optional>
The triggers configuration for this plugin.
titlestring <optional>
The dialog title.
messagestring <optional>
The dialog message.
positiveButtonstring <optional>
The dialog positive button message.
negativeButtonstring <optional>
The dialog negative button message.
iconstring <optional>
The dialog icon URL. Defaults to the default notification icon configured in the project.
styleObject <optional>
Styles to be added to the dialog container.
closeSnoozenumber | boolean <optional>
false How long to force to wait before presenting the dialog again, if the user clicks the close button. Use
falseto not set any extra snooze,trueto never present again, or give a duration in milliseconds. Defaults tofalse, which relies on the SDK's default snooze of 12 hours without forcing extra snooze.negativeSnoozenumber | boolean <optional>
604800000 How long to force to wait before presenting the dialog again, if the user clicks the close button. Use
falseto ignore,trueto never present again, or give a duration in milliseconds. Defaults to 604800, 7 days.positiveButtonBackgroundColorstring <optional>
The hex color code of the positive button.
negativeButtonBackgroundColorstring <optional>
The hex color code of the negative button.
positiveButtonTextColorstring <optional>
The hex color code of the positive button.
negativeButtonTextColorstring <optional>
The hex color code of the negative button.
backgroundColorstring <optional>
The hex color code of the dialog background.
textColorstring <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.