ExperienceNotificationService
Service containing methods to validate users and prompt them to enable
experience notifications.
Its interface does not cross the network boundary.
Instances of this class cannot be created with Instance.new.
It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service, NotReplicated]
Experience Notifications
are a way for 13+ users to keep up with their favorite experiences through
timely, personalized notifications. This service contains methods to validate
users and prompt them to enable notifications.
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
bool |
CanPromptOptInAsync()
returns true
if the local player can be prompted to enable
notifications. You should always use the result of this method before
calling PromptOptIn()
since the ability to be prompted depends on various factors like the
player's age or whether they've already enabled notifications for your
experience.
This method always infers the local player
(Players.LocalPlayer) and it can only be called from a
LocalScript or from a Script with
RunContext set to
Client. It should also be called in a
pcall() since it's an asynchronous network call
that may occasionally fail.
See
Experience Notifications
for more details on implementing and customizing notifications, using
launch data, and more.
It will block the calling thread until completion.
History 1
Tags: [Yields]
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
History 1
Parameters (0) |
---|
No parameters. |
History 1
Parameters (0) |
---|
No parameters. |
Returns (1) |
---|
null |
PromptOptIn() prompts
the local player to enable notifications through an in-experience modal.
You should always use the result of
CanPromptOptInAsync()
before calling this method since the ability to be prompted depends on
various factors like the player's age or whether they've already enabled
notifications for your experience.
This method always infers the local player
(Players.LocalPlayer) and it can only be called from a
LocalScript or from a Script with
RunContext set to
Client.
See
Experience Notifications
for more details on implementing and customizing notifications, using
launch data, and more.
History 1
Parameters (0) |
---|
No parameters. |
History 1
CreateUserNotificationAsync
It will block the calling thread until completion.
History 2
Tags: [Yields]