flutter_zoom_sdk icon indicating copy to clipboard operation
flutter_zoom_sdk copied to clipboard

Zoom Version SDK is to be low

Open ShirishModi8 opened this issue 1 year ago • 34 comments

flutter_zoom_sdk: ^1.1.0+4

any sloution how to update

ShirishModi8 avatar Mar 01 '23 12:03 ShirishModi8

Anyone is welcome to use my fork. I've just updated both Android and iOS SDKs to the latest versions (5.14.0):

flutter_zoom_sdk: git: url: https://github.com/craigspicer/flutter_zoom_sdk.git ref: main

Run the same command after adding the above to your PubSpec.yaml:

flutter pub run flutter_zoom_sdk:unzip_zoom_sdk

I also added a method: returnToMeeting();

and functionality so that the user does not get asked for details when joining: userEmail: {email}, userId: {uid},

Please note: this does not work with the iOS simulator.

craigspicer avatar Mar 23 '23 11:03 craigspicer

how can we test this zoom package using test cases ( flutter Unit testing / widget testing) basic test cases like joined in meeting after calling joinMeeting(), leave meeting and waiting for host I tried to test using console messages that prints the meeting status but it doesnt worked can u help ?

Phawhan avatar Apr 03 '23 12:04 Phawhan

I used developer logs when testing this on an Android debug build. Here's a code sample:

static const String MEETING_STATUS_CONNECTING = "MEETING_STATUS_CONNECTING"; static const String MEETING_STATUS_DISCONNECTING = "MEETING_STATUS_DISCONNECTING"; static const String MEETING_STATUS_IN_MEETING = "MEETING_STATUS_INMEETING"; static const String MEETING_STATUS_FAILED = "MEETING_STATUS_FAILED";

ZoomOptions zoomOptions = ZoomOptions( domain: "zoom.us", appKey: RemoteConfiguration.getZoomApiKey(), appSecret: RemoteConfiguration.getZoomSecret());

ZoomMeetingOptions meetingOptions = ZoomMeetingOptions(
    userEmail: user.email ?? "",
    userId: identifier ?? "Guest",
    meetingId: webinar.id,
    meetingPassword: webinar.password,
    disableMinimizeMeeting: "true",
    disableDialIn: "true",
    disableDrive: "true",
    disableInvite: "true",
    disableShare: "false",
    disableTitlebar: "false",
    viewOptions: "false",
    noAudio: "false",
    noDisconnectAudio: "true");

zoom = ZoomView();
zoom.initZoom(zoomOptions).then((results) {
  if (results[0] == 0) {
    zoom.onMeetingStatus().listen((status) {
      String currentStatus = status[0];
      developer.log("Status: " + currentStatus, name: 'Meeting.dart');
      switch (currentStatus) {
        case MEETING_STATUS_CONNECTING:
          break;
        case MEETING_STATUS_DISCONNECTING:
          break;
        case MEETING_STATUS_IN_MEETING:
          break;
        case MEETING_STATUS_FAILED:
          break;
      }
    });
    zoom.joinMeeting(meetingOptions);
  }
}).catchError((error) {
  developer.log("Error: " + error, name: 'Meeting.dart');
});

craigspicer avatar Apr 03 '23 13:04 craigspicer

So here I would just have to test my specific cases with the value currentStatus would take based on the switch case it encounters yes ?

sid-divami avatar Apr 04 '23 05:04 sid-divami

and may I know what is the developer.log method that is used here and name variable that you are using here ?

sid-divami avatar Apr 04 '23 06:04 sid-divami

Yes that's a status stream listener so the status will be logged whenever there is a new event. Here's the import statement for developer logs:

import 'dart:developer' as developer;

craigspicer avatar Apr 04 '23 06:04 craigspicer

cool. Also how do you test for a function call , since I am not returning the value of currentStatus it is inside the function call of join Meeting yes ? This is what I've written so far. I would like to know how you would approach writing the test in such a case .

import '../lib/common_functions/join_meeting.dart'; import 'package:flutter_test/flutter_test.dart';

void main(){ test('On click we should get MEETING_STATUS_CONNECTING',(){ joinMeeting('', '');
});

sid-divami avatar Apr 04 '23 10:04 sid-divami

The status stream listener is async. I'm not sure what values you would need to return but I would just handle events from function calls inside the switch statement:

zoom = ZoomView(); zoom.initZoom(zoomOptions).then((results) { if (results[0] == 0) { zoom.onMeetingStatus().listen((status) { String currentStatus = status[0]; developer.log("Status: " + currentStatus, name: 'Meeting.dart'); switch (currentStatus) { case MEETING_STATUS_CONNECTING: _doConnectingStuff(); break; case MEETING_STATUS_DISCONNECTING: _meetingEnded(); break; case MEETING_STATUS_IN_MEETING: _inMeeting = true; _inMeetingStuff(); break; case MEETING_STATUS_FAILED: _meetingFailed(); break; } }); zoom.joinMeeting(meetingOptions); } }).catchError((error) { developer.log("Error: " + error, name: 'Meeting.dart'); });

_inMeetingStuff(){ // do in meeting stuff }

_doConnectingStuff(){ // log connecting or whatever you need to do }

_meetingFailed() { // handle errors and provide user feedback }

_meetingEnded() { if (_inMeeting) { // do meeting ended stuff } _inMeeting = false; }

craigspicer avatar Apr 04 '23 11:04 craigspicer

void main(){ test('test console output with delay', () async { final logMessage = '[Meeting Status Polling] : MEETING_STATUS_WAITINGFORHOST -'; final delayDuration = Duration(seconds: 10);

await expectLater( () async { joinMeeting("8398755332", "3Y7DmN"); // calling joinMeeting function. await Future.delayed(delayDuration); // delay to call join function completer.complete(); // signal completion of the Future }(), completion(isNull), // ensure the Future returned by the function completes with null );

await expectLater( completer.future.then((_) => print('test completed')), // add debug output prints(logMessage), // expected console output ); }); }

But in got exception as

type 'FlutterError' is not a subtype of type 'String' package:infini_flutter/common_functions/join_meeting.dart 78:36 joinMeeting. ===== asynchronous gap =========================== dart:async Future.catchError package:infini_flutter/common_functions/join_meeting.dart 77:6 joinMeeting test\widgets_testing\zoom_test.dart 33:7 main.. test\widgets_testing\zoom_test.dart 36:6

Phawhan avatar Apr 04 '23 11:04 Phawhan

any updates on this issue ?

sid-divami avatar Apr 12 '23 10:04 sid-divami

@craigspicer Did you update SDK to 5.14.0 for android too?

suhailzoft avatar Apr 19 '23 16:04 suhailzoft

Yep, both.

craigspicer avatar Apr 19 '23 20:04 craigspicer

Anyone is welcome to use my fork. I've just updated both Android and iOS SDKs to the latest versions (5.14.0):

flutter_zoom_sdk: git: url: https://github.com/craigspicer/flutter_zoom_sdk.git ref: main

Run the same command after adding the above to your PubSpec.yaml:

flutter pub run flutter_zoom_sdk:unzip_zoom_sdk

I also added a method: returnToMeeting();

and functionality so that the user does not get asked for details when joining: userEmail: {email}, userId: {uid},

Please note: this does not work with the iOS simulator.

Looks like its not working. Still facing the issue SDK TOO LOW. image Is it due to latest enforcement? @craigspicer

giaotuancse avatar May 11 '23 02:05 giaotuancse

Apologies for the late reply. This seemed to be temporary error due to an issue on Zoom's side. I have, in any case, bumped the SDKs to the very latest (5.14.5) for both Android and iOS.

craigspicer avatar May 23 '23 08:05 craigspicer

Apologies for the late reply. This seemed to be temporary error due to an issue on Zoom's side. I have, in any case, bumped the SDKs to the very latest (5.14.5) for both Android and iOS.

I dont think zoom sdk version in your repo is 5.14. I upgraded to v5.14 by myself, there are code changes compare to your repo. I will publish it once done.

giaotuancse avatar May 24 '23 01:05 giaotuancse

The SDKs are absolutely 5.14.5. You can tell by the meeting UI and here are the links to the MobileRTC files:

Future checkAndDownloadSDK(String location) async { var iosSDKFile = location + '/ios/MobileRTC.xcframework/ios-arm64/MobileRTC.framework/MobileRTC'; bool exists = await File(iosSDKFile).exists();

if (!exists) { await downloadFile( Uri.parse('https://www.dropbox.com/s/loybpk4mpeyui67/MobileRTC?dl=1'), iosSDKFile); }

var iosSimulateSDKFile = location + '/ios/MobileRTC.xcframework/ios-arm64_x86_64-simulator/MobileRTC.framework/MobileRTC'; exists = await File(iosSimulateSDKFile).exists();

if (!exists) { await downloadFile( Uri.parse('https://www.dropbox.com/s/q4epumc1taqbew2/MobileRTC?dl=1'), iosSimulateSDKFile); }

var androidCommonLibFile = location + '/android/libs/commonlib.aar'; exists = await File(androidCommonLibFile).exists(); if (!exists) { await downloadFile( Uri.parse( 'https://www.dropbox.com/s/4lcc6jkgb7vi1pm/commonlib.aar?dl=1'), androidCommonLibFile); } var androidRTCLibFile = location + '/android/libs/mobilertc.aar'; exists = await File(androidRTCLibFile).exists(); if (!exists) { await downloadFile( Uri.parse( 'https://www.dropbox.com/s/195o30tjf8adnty/mobilertc.aar?dl=1'), androidRTCLibFile); } }

There are also new overrides for the zoomSDK.getInMeetingService() method on the Android side.

craigspicer avatar May 24 '23 07:05 craigspicer

The SDKs are absolutely 5.14.5. You can tell by the meeting UI and here are the links to the MobileRTC files:

Future checkAndDownloadSDK(String location) async { var iosSDKFile = location + '/ios/MobileRTC.xcframework/ios-arm64/MobileRTC.framework/MobileRTC'; bool exists = await File(iosSDKFile).exists();

if (!exists) { await downloadFile( Uri.parse('https://www.dropbox.com/s/loybpk4mpeyui67/MobileRTC?dl=1'), iosSDKFile); }

var iosSimulateSDKFile = location + '/ios/MobileRTC.xcframework/ios-arm64_x86_64-simulator/MobileRTC.framework/MobileRTC'; exists = await File(iosSimulateSDKFile).exists();

if (!exists) { await downloadFile( Uri.parse('https://www.dropbox.com/s/q4epumc1taqbew2/MobileRTC?dl=1'), iosSimulateSDKFile); }

var androidCommonLibFile = location + '/android/libs/commonlib.aar'; exists = await File(androidCommonLibFile).exists(); if (!exists) { await downloadFile( Uri.parse( 'https://www.dropbox.com/s/4lcc6jkgb7vi1pm/commonlib.aar?dl=1'), androidCommonLibFile); } var androidRTCLibFile = location + '/android/libs/mobilertc.aar'; exists = await File(androidRTCLibFile).exists(); if (!exists) { await downloadFile( Uri.parse( 'https://www.dropbox.com/s/195o30tjf8adnty/mobilertc.aar?dl=1'), androidRTCLibFile); } }

There are also new overrides for the zoomSDK.getInMeetingService() method on the Android side. image

Your latest commit to update lib files to v5.14 is correct. But you need to do code migration as well, just updated those lib files wont work. For example, minSDK version for version 5.14 is 23, whereas in your repo is 21.
image

Gradle version also need to be updated.

giaotuancse avatar May 30 '23 05:05 giaotuancse

Yes, code does need to be changed when the SDKs are updated. Please refer to the changes in FluttterZoomSdkPlugin.java. Specifically, the additional overrides implemented for zoomSDK.getInMeetingService(). You can clearly see that the necessary code was implemented for v5.14.5 (otherwise it would not even compile). You can update the minimum SDK version in your own app level build.gradle file.

craigspicer avatar May 30 '23 09:05 craigspicer

Please also note the following: Please be aware that in order to update the SDKs you need to completely remove the dependency-

flutter_zoom_sdk: git: url: https://github.com/craigspicer/flutter_zoom_sdk.git ref: main

Then add the dependency back and run:

flutter pub run flutter_zoom_sdk:unzip_zoom_sdk

You will see console messages with information about the MobileRTC files being downloaded. The SDKs DO NOT automatically keep themselves up to date on your local machine.

The latest Zoom SDKs also do not seem to work on debug builds.

craigspicer avatar May 30 '23 10:05 craigspicer

Yes, code does need to be changed when the SDKs are updated. Please refer to the changes in FluttterZoomSdkPlugin.java. Specifically, the additional overrides implemented for zoomSDK.getInMeetingService(). You can clearly see that the necessary code was implemented for v5.14.5 (otherwise it would not even compile). You can update the minimum SDK version in your own app level build.gradle file.

Hi, Have you completed the code? I'm getting the same issue and have to resolve it asap.

Riya-Singhal15 avatar May 30 '23 10:05 Riya-Singhal15

Yes, the SDKs are working - please follow the steps in my previous comment and bump the minimum SDK version to 23 in your app level build.gradle file.

craigspicer avatar May 30 '23 10:05 craigspicer

@craigspicer Hi, what about appKey and appSecret its does not exist ? please answer me ASAP thanks

zoualfkar15 avatar Aug 02 '23 18:08 zoualfkar15

@zoualfkar15 It has changed in the latest SDK. Now, only the signature is needed.

suhailzoft avatar Aug 02 '23 19:08 suhailzoft

That is correct - Zoom has removed those interfaces in the latest SDKs. You must now init with JWT signature.

craigspicer avatar Aug 02 '23 20:08 craigspicer

Thanks man , i faced this error flutter version : 3.10.5

What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform mobilertc-.aar (:mobilertc:) to match attributes {artifactType=android-aar-metadata, org.gradle.status=integration}. > Execution failed for JetifyTransform: C:\Users\FPCC\AppData\Local\Pub\Cache\git\flutter_zoom_sdk-5ad7a3f4656a7c4b2554166200db9f2edcbede20\android\libs\mobilertc.aar. > Failed to transform 'C:\Users\FPCC\AppData\Local\Pub\Cache\git\flutter_zoom_sdk-5ad7a3f4656a7c4b2554166200db9f2edcbede20\android\libs\mobilertc.aar' using Jetifier. Reason: EOFException, message: Unexpected end of ZLIB input stream. (Run with --stacktrace for more details.) Suggestions: - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there. - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

zoualfkar15 avatar Aug 02 '23 22:08 zoualfkar15

@craigspicer @suhailzoft can you help me please

zoualfkar15 avatar Aug 03 '23 12:08 zoualfkar15

@craigspicer @suhailzoft any update

zoualfkar15 avatar Aug 23 '23 11:08 zoualfkar15

That is correct - Zoom has removed those interfaces in the latest SDKs. You must now init with JWT signature.

The JWT app type will be deprecated. We recommend that you create Server-to-Server OAuth or OAuth apps to replace the functionality of a JWT app in your account. See the JWT app type migration guide for details. those from Zoom developer say that JWT is now unused, so how can we update to the latest changes?

YoussefAbdelmonem avatar Sep 11 '23 13:09 YoussefAbdelmonem

@YoussefAbdelmonem It's only the JWT app type that has been deprecated. The meeting SDK must still be initialised with a JWT signature.

craigspicer avatar Sep 11 '23 13:09 craigspicer

@YoussefAbdelmonem It's only the JWT app type that has been deprecated. The meeting SDK must still be initialized with a JWT signature.

thank you for your answer I will try it now but can you please tell me how to generate JWT token so I can add in zoom meeting options I added a jwt token that was in Zoom documentation and when I submitted it, there where an error Failed to initialize Zoom SDK

YoussefAbdelmonem avatar Sep 11 '23 13:09 YoussefAbdelmonem