Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We have a chat application, we want to check to see if a specific Member ID is online to chat. I can only find information on getting a current Member ID to check to see if they are online. Is there a way to find a specific member id and see if they are online.
Is this something that Member Services can do?
Hi Matthew and welcome to Our
You will be able to find the member by ID. See this link for reference
Would we be able take that Member ID then and check and see if that Member ID is online?
Thanks for the quick reply.
You can check if a user is online using code similar to below
IMember member= memberService.GetByEmail("someemailaddress");
MemberShipUser user = Membership.GetUser(member.Username);
bool online = user.IsOnline;
You are welcome Matthew
You can find differens Umbraco helpers here https://our.umbraco.com/documentation/reference/querying/umbracohelper/#working-with-members there are different once, some of them are for members
Hope this helps,
Yep, that it always help :D
As far as I know there is no built-in functionality for this. It also depends a lot on what your definition of being online is. That the member has the page actively open, or that the member has recently opened a page?
For real-time things like chat applications I would rather use websockets I think. Or another solution could be to use ajax to call a controller every x seconds that does something with the memberid, such as caching it in a list and clear the ones that have not been active since a while.
Yeah some sort of keep alive ping would be a good solution here. Although you might need to get permission from the user before you capture this info.
Then if you have a table of ids and last ping datetime you can get an idea of who is or was recently online. You can clear this table of people who haven’t been online in the last however x many minutes to stop it getting bloated
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted