How to use the presence API to mark a user present at a location
This API method allows you to mark the viewing user as present at the provided location.
window.CordSDK.presence.setPresent(location, options);
window.CordSDK.presence.setPresent({
page: "https://cord.com",
block: "id123",
}, {durable: true});
This function does not return anything.
false
.false
.exclusive_within
.
If the user becomes present at a different location with the same value of exclusive_within
, they
automatically become no longer present at all other locations with that value of exclusive_within
.window.CordSDK.presence.setPresent({
page: pageID,
paragraph: paragraphID,
}, {
exclusive_within: {page: pageID}
});
paragraphID
will change, while their pageID
will remain the same.
The above call to setPresent
will mark them present at their specific paragraph.
However, since every update uses the same exclusive_within
, each time they are marked present at one paragraph
they will become no longer present at their previous paragraph.location
argument (which effectively disables this behavior).Not finding the answer you need? Ask our Developer Community