You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window.OneSignalDeferred.push(async (OneSignal) => {
await OneSignal.init({
appId: import.meta.env.VITE_PUBLIC_PUSH_APP_ID,
safari_web_id: import.meta.env.VITE_PUBLIC_PUSH_SAFARI_ID,
allowLocalhostAsSecureOrigin: location.hostname === 'localhost',
promptOptions: {
actionMessage:
'Would you like to be notified this is a test',
acceptButton: 'Sure',
slidedown: {
prompts: [
{
type: 'push',
autoPrompt: true,
delay: { timeDelay: 5 },
},
],
},
},
welcomeNotification: {
disable: true,
},
})
})
The slidedown (which waits the proper 5 seconds) shows as:
Other adjustments I make to this initialize work properly (add/remove the notifyButton, alter the time delay, etc). I've tried placing the actionMessage in promptOptions, promptOptions.slidedown and promptOptions.slidedown.prompts[0] (the documentation isn't entirely clear where this should be placed). None of these seem to work.
What browsers are you seeing the problem on?
Chrome (Chromium)
What operating system are you running?
macOS Catalina + Chrome Version 120.0.6099.199 (Official Build) (x86_64)
Steps to reproduce?
See description.
The application is a SolidJS and it's initialized in a Provider using the code above. Changes to that initialization object apply properly except the actionMessage.
What did you expect to happen?
The actionMessage (and button text) to be updated properly.
Relevant log output
N/A
The text was updated successfully, but these errors were encountered:
If you really need to set these options from code you will need to set "Custom Code" on the Choose Integration step.
The JSON structor to set actionMessage under promptOptions.slidedown.prompts[]. Example:
promptOptions: {slidedown: {prompts: [{type: "category",autoPrompt: true,text: {actionMessage: "We'd like to show you notifications for the latest news and updates.",acceptButton: "Allow",cancelButton: "Cancel",/* CATEGORY SLIDEDOWN SPECIFIC TEXT */negativeUpdateButton: "Cancel",positiveUpdateButton: "Save Preferences",updateMessage: "Update your push notification subscription preferences.",},}]}}
What happened?
I'm setting the
actionMessage
during initialization but it continues to show the default message.SDK:
https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js
Code:
The slidedown (which waits the proper 5 seconds) shows as:
Other adjustments I make to this initialize work properly (add/remove the notifyButton, alter the time delay, etc). I've tried placing the
actionMessage
inpromptOptions
,promptOptions.slidedown
andpromptOptions.slidedown.prompts[0]
(the documentation isn't entirely clear where this should be placed). None of these seem to work.What browsers are you seeing the problem on?
Chrome (Chromium)
What operating system are you running?
macOS Catalina + Chrome Version 120.0.6099.199 (Official Build) (x86_64)
Steps to reproduce?
What did you expect to happen?
The actionMessage (and button text) to be updated properly.
Relevant log output
The text was updated successfully, but these errors were encountered: