Настройка скрипта (SDK)

Инициализация скрипта

Если вы достаточно уверено работаете с Javascript, вы можете инициализировать Pushflow API самостоятельно. В противном случае, воспользуйтесь конструктором на странице фида.

Pushflow.init() options:

var pushflowSettings = {
failedUrl: "https://failedurl.com",
allowUrl: "https://allowUrl.com",
denyUrls: ["denyUrls.com", "1.denyUrls.com", "2.denyUrls.com"],
vapidPublic: "vapidpublic",
feedId: "1",
subscribeOnPageLoad: false,
subscribeOnPageLoadDelay: 2000,
isDebug: false,
onSuccessCallback: function() {},
onFailedCallback: function() {},
onDeniedCallback: function() {},
workerPath: "/sw-pushflownet.js",
clickid: "123456",
t1: "123456",
t2: "123456",
t3: "123456",
t4: "123456",
t5: "123456",
widgets: {
isShowRobot: false,
isShowDialog: false,
dialogOptions: {
position: 'top-center',
isLockBackground: false,
delay: 300,
title: "We'd like to show you notifications for the latest updates",
text: "",
subscribeButton: "Allow",
cancelButton: "Cancel",
icon: "https://yourdomain.com/icon.png",
},
isLockBackground: false,
lockBackgroundOptions: {
isShowText: true,
text: ""
},
isShowNotification: false,
showNotificationOptions: {
title: "Success"
},
isShowBubble: false,
bubbleOptions: {
text: "New Message Request",
icon: "https://yourdomain.com/icon.png",
delay: 500
}
}
};