Is there an idiomatic way to subscribe a specific user to a custom channel

Josh Willing:
Is there an idiomatic way to subscribe a specific user to a custom channel when they load a page and unsubscribe them when they leave that page?

context: I want my FMS to push a modal dialog message to the user if they happen to still be on the page when a slow PSOS script finishes, otherwise don’t send the message. Or is there another feature of channels that I’m missing that would help me do this “right”?


Delfs:
Hi Josh,
A bit different because you don’t really know where the user is and you always want to tell them that the process finished. One way we have done this is by adding some type of progress indicator into app. Then when the process finishes you can indicate that in ahead or etc. Next to target the specific user, I would target their tab where they started the PSOS from. Alternately, you can also target the iduser because they could be even on a different tab, depending on the nature of your app.

If you only want to show this alert, when they are on that specific page, you could easily check the navigation when the messages received by that user.

For something like this, I would create a name, action called psosProcessDone and in that named action some JavaScript can check the URL for the appropriate path and if it does not match you can just clear the rest of the actions otherwise show the alert.
Let me know if this helps

.


Josh Willing:

For something like this, I would create a name, action called psosProcessDone and I’m not named action some JavaScript can check the URL for the appropriate path and if it does not match you can just clear the rest of the actions otherwise show the alert.
Let me know if this helps
THIS is exactly the piece that was missing in my mental model. I was sending a show modal action from the server, but didn’t know how in BF to “conditionally obey” the server’s direction to show a modal. Named Action it will be!

Thanks @Delfs