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

Fire RN events on meeting- and auth events #61

Merged
merged 7 commits into from Mar 4, 2021

Conversation

jcamins
Copy link
Contributor

@jcamins jcamins commented Feb 25, 2021

This adds RN events on:

  • Auth initialization
  • Meeting status changes
  • Meeting departure
  • Screen sharing start/stop

We could fire events on other things as well, but these are the ones that I have needed to handle screen sharing in our React Native app smoothly. I'm not certain this is the right approach, since—particularly on Android with InMeetingServiceListener methods—it results in a rather large amount of additional code, but it works well for us.

Copy link
Owner

@mieszko4 mieszko4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I just have few comments regarding code readability improvement.

case MeetingEndReason.END_BY_SELF: return "endedBySelf";
case MeetingEndReason.END_FOR_FREEMEET_TIMEOUT: return "endedFreeMeetingTimeout";
case MeetingEndReason.END_FOR_JBHTIMEOUT: return "endedJBHTimeout";
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this android only? it is missing in ios

Copy link
Contributor Author

@jcamins jcamins Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I do not understand your reply. My point is that endedNoAttendee has no corresponding reason for ios (see https://marketplacefront.zoom.us/sdk/meeting/ios/_mobile_r_t_c_constants_8h_source.html line 487)
so it should be put as the last case and marked as such:

Suggested change
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee";
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee"; // Android only

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 03a5ad4

Comment on lines 285 to 287
inMeetingService.removeListener(this);
InMeetingShareController inMeetingShareController = inMeetingService.getInMeetingShareController();
inMeetingShareController.removeListener(this);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should check if inMeetingService/inMeetingShareController is null before calling removeListener

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right. I missed doing this in a few other places, too. I'll fix that.

ios/RNZoomUs.m Outdated
case MobileRTCAuthError_None: return @"none"; // iOS only
case MobileRTCAuthError_OverTime: return @"overTime"; // iOS only
case MobileRTCAuthError_NetworkIssue: return @"networkIssue"; // iOS only
case MobileRTCAuthError_ClientIncompatible: return @"clientIncompatible";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order to make the mappings to be more readable. put common ios/android cases on top and sort all of the return alphabetically.
In this way it will be easier to compare what is in java and what is in objective-c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

case MeetingEndReason.END_FOR_JBHTIMEOUT: return "endedJBHTimeout";
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee";
case MeetingEndReason.KICK_BY_HOST: return "endedRemovedByHost";
default: return "endedUnknownReason";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that should be "unknown" for consistency with other events

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still a MeetingEvent, which is why I made it "endedUnknownReason" instead of "unknown". I could make it a separate event, but for our use case, it's not actually that useful to have the meeting end events separate from other meeting events (error, connect).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I think that's ok

Copy link
Owner

@mieszko4 mieszko4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thnx! I will merge it now

case MeetingEndReason.END_BY_SELF: return "endedBySelf";
case MeetingEndReason.END_FOR_FREEMEET_TIMEOUT: return "endedFreeMeetingTimeout";
case MeetingEndReason.END_FOR_JBHTIMEOUT: return "endedJBHTimeout";
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I do not understand your reply. My point is that endedNoAttendee has no corresponding reason for ios (see https://marketplacefront.zoom.us/sdk/meeting/ios/_mobile_r_t_c_constants_8h_source.html line 487)
so it should be put as the last case and marked as such:

Suggested change
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee";
case MeetingEndReason.END_FOR_NOATEENDEE: return "endedNoAttendee"; // Android only

@mieszko4 mieszko4 merged commit cb75c5d into mieszko4:master Mar 4, 2021
@mieszko4
Copy link
Owner

mieszko4 commented Mar 4, 2021

@jcamins What would be really useful is having an example in README.md of how to subscribe to an event.

@jcamins
Copy link
Contributor Author

jcamins commented Mar 10, 2021

@mieszko4 I have not forgotten your request. I created a ticket for myself to make sure that I do it.

@fridaland fridaland mentioned this pull request Mar 17, 2021
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.

None yet

2 participants