25LucasAnselmo / gr_zoom

Apache License 2.0
4 stars 12 forks source link

Prevent the registration prompt showing when joining a webinar on Android #21

Open RB-93 opened 1 month ago

RB-93 commented 1 month ago

We are using a Zoom SDK pkg v1.3.0.+1 and would like to prevent prompting a user to register for a webinar on Android when joining.

I have tried couple of things like _stop listening onMeetingStateChanged results when status[0] == "MEETING_STATUSDISCONNECTING", storing booleans as per status and do intended task.

But it couldn't help much.

Code snippet:

Future<void> _startzoomMeeting(
    String userEmail,
    String meetID,
    String meetPassword,
    String fullName,
    int? eventId,
    int? userId,
  ) async {
    // initPlatformState();

    final tokenIssueTimestamp =
        widget.webinarData.parsedStartDate.millisecondsSinceEpoch ~/
            Duration.millisecondsPerSecond;
    final tokenExpireTimestamp =
        ((widget.webinarData.parsedEndDate.add(const Duration(minutes: 30)))
                .millisecondsSinceEpoch) ~/
            Duration.millisecondsPerSecond;

    // print(' permission for phone use given');
    // var result = false;    

    try {
      ZoomOptions zoomOptions = ZoomOptions(
        domain: "zoom.us",
        jwtToken: generateJWT(
          tokenIssueTimestamp,
          tokenExpireTimestamp,
        ),
        customAndroidUi: true,
      );
      var meetingOptions = ZoomMeetingOptions(
        userId: fullName,
        meetingId: meetID,
        meetingPassword: meetPassword,
        meetingName: widget.webinarData.title,
        displayName: fullName,
        disableDialIn: "true",
        disableDrive: "true",
        disableInvite: "true",
        disableShare: "true",
        noAudio: "false",
        noDisconnectAudio: "false",
      );     

      await grZoomPlugin.init(zoomOptions).then((results) async {
        print(results[0]);
        if (results[0] == 0) {
          grZoomPlugin.onMeetingStateChanged.listen((status) async {
            logger.i('[Meeting Status Stream] : \n${status[0]} \n${status[1]}');
            if (status[0] == 'MEETING_STATUS_FAILED') {
              return;
            } else if (status[0] == 'MEETING_STATUS_INMEETING') {
              // logJoinEntry();
            } else {
              if (status[0] == "MEETING_STATUS_DISCONNECTING" &&
                  status[0] != "MEETING_STATUS_ENDED") {
                grZoomPlugin.onMeetingStateChanged.drain();

                // logLeaveEntry();

                /* push(
                  context,
                  WebinarThanksScreen(webinarData: widget.webinarData),
                ); */
              } /* else if (status[0] == "MEETING_STATUS_IDLE") {
                snak(context, 'Webinar is yet to start');
              } */
              else if (status[0] == "MEETING_STATUS_WAITINGFORHOST") {
                snak(context, 'Webinar host has not joined yet');
              }
            }
          });
          logger.i('listen on event channel');
          await grZoomPlugin
              .joinMeeting(meetingOptions)
              .then((joinMeetingResult) {
            logger.i(
                'joinMeetingResult : $joinMeetingResult --- \nMeeting join success');
          }).catchError((error, stackTrace) {
            logger.e('Error in Join meeting',
                error: error, stackTrace: stackTrace);
          });
        }
      }).catchError((error, stackTrace) {
        logger.e('Error in Initilaizing ZoomSDK',
            error: error, stackTrace: stackTrace);
      });
    } catch (e, s) {
      logger.e('Error in setting ZoomSDK options', error: e, stackTrace: s);
    }
}

Steps to reproduce:

  1. Try to join webinar meeting using the provided code snippet.
  2. It shows the register popup dialog for a hosted Zoom Webinar.

image

The issue does not occur in iOS build.

I also tried to find similar issues reported in other framework SDKs and in gr_zoom internal class:

Relative Internal classes (which may require changes):

image

image

Please look into this issue and resolve as soon as possible.

25LucasAnselmo commented 1 week ago

Hi. Try disabling option customAndroidUi => customAndroidUi: false

RB-93 commented 1 week ago

Hi. Try disabling option customAndroidUi => customAndroidUi: false

Yes tried already, haven't worked. Could you please look into this issue further.