Compare OneSignal Web SDK methods between the legacy Player Model and the new User Model. Learn how to migrate your implementation with TypeScript-based code examples and updated method references.
OneSignalSDKWorker.js
file:
Player Model:
importScripts
URL.
See OneSignal Service Worker for more information.
init()
provideUserConsent()
showNativePrompt()
registerForPushNotifications()
— Dropped in User Model#permissionPromptDisplay
showSlidedownPrompt()
showHttpPrompt()
— Dropped in User ModelshowCategorySlidedown()
#getNotificationPermission
isPushNotificationsSupported()
isPushNotificationsEnabled()
#subscriptionChange
#notificationPermissionChange
#popoverShown
#customPromptClick
getUserId()
setExternalUserId()
removeExternalUserId()
getExternalUserId()
sendTag()
sendTags()
getTags()
deleteTag()
deleteTags()
sendSelfNotification()
— Dropped in User ModelsetSubscription()
#notificationDisplay
#notificationDismiss
#addListenerForNotificationOpened
setEmail()
logoutEmail()
getEmailId()
— Dropped in User ModelsetSMSNumber()
logoutSMSNumber()