-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add online/offline indicator (next) #16
Comments
Pending library support, will reopen once I'm able to integrate it |
hey @aguilaair! I gave a quick shot to Presence by drafting something real quick in class _PaperCupsWidgetState extends State<PaperCupsWidget> {
bool _connected = false;
PhoenixSocket? _socket;
PhoenixSocket? _socket;
+ PhoenixPresence? _presence;
PhoenixChannel? _channel; void setConversationChannel(PhoenixChannel c) {
_conversationChannel = c;
+ _presence = PhoenixPresence(channel: c);
+ _presence?.onSync = () => setState(() {});
} Widget build(BuildContext context) {
initChannels(
_connected,
_socket!,
_channel,
widget.props,
_canJoinConversation,
rebuild,
);
if (widget.props.primaryColor == null &&
widget.props.primaryGradient == null)
widget.props.primaryColor = Theme.of(context).primaryColor;
+ if (_presence != null) {
+ final presences = _presence!.list(_presence!.state);
+
+ print('🔥 presences: $presences | _presence.state: ${_presence!.state}');
+ } But all I get with that last print is: |
Hey @cheeseblubber Thanks for taking a shot at this! I'll take a look at this as soon as I get some time, rn I'm applying to unis so I have limited time. However, in theory, once someone becomes online (the support agent), the list should become populated with the agent and we should be able to show that they are available |
Hey @aguilaair I did try this with the Papercups dashboard on the side and entering/leaving the convo + dropping messages didn't trigger anything. But it's nothing urgent for now: best of luck with your application! 🍀 |
Cannot currently be done, presence state is not supported on the plugin that is being used.
The text was updated successfully, but these errors were encountered: