How do Experience notifications work?

I read the documentation and asked AI but I’m still not sure how they work, I have the following questions down below.

  1. How they are sent, do I have to manually send them to the user or roblox decides when to send them?
  2. Do they get sent even if there are no servers?
  3. How do I choose the users to who to send?
local ServerScriptService = game:GetService("ServerScriptService")

local OCUserNotification = require(ServerScriptService.OpenCloud.V2.UserNotification)
local recipientPlayerID = 505306092

-- In the payload, "messageId" is the value of the notification asset ID
local userNotification = {
	payload = {
		messageId = "5dd7024b-68e3-ac4d-8232-4217f86ca244",
		type = "MOMENT"
	}
}

local result = OCUserNotification.createUserNotification(recipientPlayerID, userNotification)

if result.statusCode ~= 200 then
	print(result.statusCode)
	print(result.error.code)
	print(result.error.message)
end

I kinda don’t understand this piece of code, does the server have to join the game to get the notification?

  1. They’re sent on an Open Cloud endpoint. You manually create notifications and Roblox can throttle/block any for spam. They may be delayed but they aren’t scheduled with any reasonable precision.
  2. Notifications don’t care about game servers. This example and the package for it inherently have to run on an active game server. The endpoint is accessible to external tools.
  3. Collect IDs of users who enable notifications when prompted, then fire the endpoint for each ID that the notification is applicable for.

No? I don’t know what you mean by “servers getting a notification”. There is only a reliance on game servers if you’re using that example code because it references the datamodel of a running game.

1 Like

So I can use something like google scripts which sends notifcations every 3 days to listen users, is my assumption correct?

Yeah. If it wasn’t already obvious, datastores are also accessible to Open Cloud and you should check out the rate limits for notifications.

So I can use roblox data stores to send notifcations when servers are active instead of using a third party program right?

Yeah, that’d work. Besides global promotional notifications, handling this in game lets you bind to player actions much easier. For example, a player’s offline base being raided can notify them.

1 Like