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

Fixed presence events member_added and member_removed not triggering for iOS #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexkok
Copy link

@alexkok alexkok commented Mar 6, 2021

Hi! Thanks for this library, using it with authenticated private and presence channels.

While using it, I stumbled upon an issue in iOS where it doesn't trigger the pusher:member_added and pusher:member_removed events at all with the presence channels. Making it impossible for the presence on iOS to know who joined or left.

Fixing that in this PR because it was never being triggered in Flutter for iOS and wanted to fix that to make it work.
The change made is that it uses the onMemberAdded and onMemberRemoved which the Pusher Swift SDK describes to register for these callbacks (see https://github.com/pusher/pusher-websocket-swift#swift-12).
Next, the event is published with the same name as we expect to the Flutter side, as done with the other events.

This fixes the issue where the pusher:member_added and pusher:member_removed events are not being triggered.

When looking at the issues on the repo, I saw that #2 is facing the same issue in the first part of the issue. So this will also fix the first part of #2.

Summary

  • [Flutter] No changes
  • [Android] No changes
  • [iOS] Internal change: Fixes pusher:member_added and pusher:member_removed usage when using presence channels

Additional note (Also related to #2)

However, the data send with the pusher:subscription_succeeded event differs much from Android (except for the user_id). That is another issue, and matches to the second part of #2, the 'improvement' that is suggested there.
I was also facing this issue when parsing the messages on Android. Currently still parsing the data manually in Flutter to fix this inconsistency.

@adham-ashraf77
Copy link

can you do the fix for android too, please?

@adham-ashraf77
Copy link

@alexkok

@adham-ashraf77
Copy link

fixed from 2021 can you fix it again ?

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

Successfully merging this pull request may close these issues.

2 participants