Registration Page
Collect opt-in permission in a secure form.
Installation
The Airship Web SDK provides plugins that extend its functionality to help with user acquisition and onboarding.
Use the load()
method to load your plugin along with the plugin name
and the url
for the Airship-hosted CDN (Either North America or EU depending on your location), and any additional options.
UA.then(sdk => {
sdk.plugins.load('my-plugin', 'https://my.plugin.url', {my_option: 'my_value'})
.then(plugin => plugin.myMethod())
})
URL and options values are provided in the specific plugin sections.
See our Plugins class reference for more details.
Registration Page
When integrating the Airship SDK on a non-HTTPS website, this plugin allows you to open a registration page inside a popup on the correct HTTPS-enabled registration domain to collect user opt-in permission.
It can be used in conjunction with the HTML Prompt plugin.
Prerequisite: You must upload the registration-page.html
file from the SDK bundle to your website and make it accessible through HTTPS.
URL, Options, and Methods
When loading the plugin, you will provide the url
for the CDN-hosted plugin
along with an options
object. URL values and available options and methods are described below.
URL
The URL will differ depending on whether you are using our North America or EU data center.
- North America:
https://aswpsdkus.com/notify/v1/ua-registration-page.min.js
- EU:
https://aswpsdkeu.com/notify/v1/ua-registration-page.min.js
Options
The following attributes are optional but we strongly recommend setting url
with the fully-qualified HTTPS URL of your registration-page.html file,
and i18n
according to your users’ primary region.
Key | Type | Default | Description |
---|---|---|---|
defaultLanguage | string | ’en' | Default language to be used when translation is not available |
width | number | 600 | Popup width |
height | number | 390 | Popup height |
url | string | ‘./registration-page.html’ | Registration page URL |
i18n.{lang}.title | string | ‘…’ | Popup title |
i18n.{lang}.message | string | ‘…’ | Message displayed in the popup |
i18n.{lang}.bubble | string | ‘…’ | Message displayed when permission is denied |
i18n.{lang}.button | string | ‘…’ | Message displayed in button when user interaction is needed |
position | string | ‘middle_center’ | Popup position. One of top_center , top_left , top_right , bottom_center , bottom_left , bottom_right , middle_center , middle_left , middle_right |
Methods
.open(options = {})
: Open the registration page popup. More options can be passed into this method to override the ones passed when loading the plugin.
// this a just a simple example - you should bind this code to a click event
// to get it compatible with most browsers
UA.then(sdk => {
sdk.plugins
.load('registration-page', 'https://aswpsdkus.com/notify/v1/ua-registration-page.min.js', {
i18n: {
fr: {
title: 'Autoriser les notifications Web',
message: 'Souscrivez aux notifications',
bubble: 'Changez la permission pour permettre les notifications',
button: 'Autoriser'
},
en: {
title: 'Opt in to Web Notifications',
message: 'Subscribe to web notifications by clicking [Allow] in the prompt.',
bubble: 'Unlock permission to allow notifications',
button: 'Allow'
}
// you can also use locales to set more specific messages
// 'en-US': [...],
// 'fr-CA': [...]
}
})
.then(plugin => plugin.open())
});
Categories