メインコンテンツへスキップ
OneSignalは、デバイス中心モデル(Player ID)からユーザー中心モデル(OneSignal ID)に更新されました。移行ガイダンスについては、User Model Migration Guideを参照してください。レガシーデバイス中心実装のドキュメントについては、Version 9を参照してください。

概要

このドキュメントでは、OneSignalのレガシーPlayer Model Web SDKから新しいUser Model SDKへのメソッド、プロパティ、イベントをマッピングします。各セクションには一致するTypeScriptコード例が含まれており、統合を更新する方法を明確に示しています。 すべての例はデモンストレーション目的で簡素化されています。完全で最新の実装については、各メソッドまたはイベントの下に提供されているドキュメントリンクを参照してください。

OneSignal Service Worker

OneSignalSDKWorker.jsファイルのインポートを更新します: Player Model:
User Model:
ファイルパスは同じままにします。importScripts URLのみを更新してください。 詳細については、OneSignal Service Workerを参照してください。

初期化

init()

Player Model: Docs
User Model: Docs

provideUserConsent()

Player Model: Docs
User Model: Docs

プッシュの登録

showNativePrompt()

Player Model:
User Model: Docs

registerForPushNotifications() — Dropped in User Model

#permissionPromptDisplay

Player Model:
User Model: Docs

showSlidedownPrompt()

Player Model:
User Model: Docs

showHttpPrompt() — Dropped in User Model

showCategorySlidedown()

Player Model:
User Model: Docs

#getNotificationPermission

Player Model:
User Model: Docs

isPushNotificationsSupported()

Player Model:
User Model: Docs

isPushNotificationsEnabled()

Player Model:
User Model: Docs

#subscriptionChange

Player Model:
User Model:

分析

#notificationPermissionChange

Player Model:
User Model: Docs

#popoverShown

Player Model:
User Model: Docs

#customPromptClick

Player Model:
User Model: Docs

ユーザーID

getUserId()

Player Model:
User Model: Docs

setExternalUserId()

Player Model: Docs
User Model: Docs

removeExternalUserId()

Player Model:
User Model: Docs

getExternalUserId()

Player Model:
User Model: Docs

タグ

sendTag()

Player Model:
User Model:
User Model doc

sendTags()

Player Model:
User Model:

getTags()

Player Model:
User Model:

deleteTag()

Player Model:
User Model:

deleteTags()

Player Model:
User Model:

プッシュ通知

sendSelfNotification() — Dropped in User Model

setSubscription()

Player Model:
User Model:

通知の受信

#notificationDisplay

Player Model:
User Model:

#notificationDismiss

Player Model:
User Model:

#addListenerForNotificationOpened

Player Model:

メール

setEmail()

User Model doc Player Model:
User Model:

logoutEmail()

Player Model:
User Model:

getEmailId() — Dropped in User Model

SMS

setSMSNumber()

Player Model:
User Model:

logoutSMSNumber()

Player Model:
User Model: