Skip to content
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

Open
aguilaair opened this issue Dec 6, 2020 · 4 comments
Open

✨ Add online/offline indicator (next) #16

aguilaair opened this issue Dec 6, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@aguilaair
Copy link
Collaborator

Cannot currently be done, presence state is not supported on the plugin that is being used.

@aguilaair aguilaair added this to the 2.0.0 milestone Dec 6, 2020
@aguilaair aguilaair self-assigned this Dec 6, 2020
@aguilaair aguilaair added enhancement New feature or request next labels Dec 6, 2020
@aguilaair aguilaair changed the title ✨ Add online/offline indicator ✨ Add online/offline indicator (next) Dec 6, 2020
aguilaair added a commit that referenced this issue Dec 26, 2020
@aguilaair aguilaair added the wontfix This will not be worked on label Feb 7, 2021
@aguilaair
Copy link
Collaborator Author

aguilaair commented Feb 7, 2021

Pending library support, will reopen once I'm able to integrate it

@aguilaair aguilaair reopened this Sep 12, 2021
@aguilaair aguilaair removed wontfix This will not be worked on blocked next labels Nov 14, 2021
@CharlesMangwa
Copy link
Contributor

hey @aguilaair! I gave a quick shot to Presence by drafting something real quick in ./lib/papercups_flutter.dart as such:

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: 🔥 presences: [] | _presence.state: {} and as I mentioned in #77 (comment), I didn't get what I should be expecting/how to test the feature, even after looking at the example project. Any tip would be highly appreciated here.

@aguilaair
Copy link
Collaborator Author

aguilaair commented Dec 13, 2021

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

@aguilaair aguilaair assigned CharlesMangwa and unassigned aguilaair Dec 13, 2021
@CharlesMangwa
Copy link
Contributor

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! 🍀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants