ark-brighthustle / flutter_zoom_sdk

Zoom SDK from ZOOM ported to flutter as plugin with all necessary features and with Null Safety which is implementation by CodeSyncr
BSD 3-Clause "New" or "Revised" License
39 stars 84 forks source link

Zoom Version SDK is to be low #117

Open ShirishModi8 opened 1 year ago

ShirishModi8 commented 1 year ago

flutter_zoom_sdk: ^1.1.0+4

any sloution how to update

craigspicer commented 1 year ago

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.

Phawhan commented 1 year ago

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 ?

craigspicer commented 1 year ago

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');
});
sid-divami commented 1 year ago

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 commented 1 year ago

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

craigspicer commented 1 year ago

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;

sid-divami commented 1 year ago

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('', '');
});

craigspicer commented 1 year ago

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; }

Phawhan commented 1 year ago

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

sid-divami commented 1 year ago

any updates on this issue ?

suhailzoft commented 1 year ago

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

craigspicer commented 1 year ago

Yep, both.

giaotuancse commented 1 year ago

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

craigspicer commented 1 year ago

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.

giaotuancse commented 1 year ago

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.

craigspicer commented 1 year ago

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.

giaotuancse commented 1 year ago

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.

craigspicer commented 1 year ago

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 commented 1 year ago

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.

Riya-Singhal15 commented 1 year ago

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.

craigspicer commented 1 year ago

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.

zoualfkar15 commented 11 months ago

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

suhailzoft commented 11 months ago

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

craigspicer commented 11 months ago

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

zoualfkar15 commented 11 months ago

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:

zoualfkar15 commented 11 months ago

@craigspicer @suhailzoft can you help me please

zoualfkar15 commented 10 months ago

@craigspicer @suhailzoft any update

YoussefAbdelmonem commented 10 months ago

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?

craigspicer commented 10 months ago

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

YoussefAbdelmonem commented 10 months ago

@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 commented 10 months ago

@craigspicer I solved the issue of generating a jwt token but there is another issue that appear whenever I try to join a meeting Failed to initialize Zoom SDK I try adding void main()async { WidgetsFlutterBinding.ensureInitialized(); await ZoomView().initZoom( ZoomOptions( domain: "zoom.us", jwtToken: generateJwtToken(),

)

);

runApp(const MyApp()); } but the problem still doesn't solve I will be thankful if you can solve this issue

zoualfkar15 commented 6 months ago

Helle @craigspicer

I'm experiencing an issue on Android when trying to join a meeting. Could you please provide assistance? this is the error:

E/AndroidRuntime(12097): java.lang.NoSuchMethodError: No static method getOrCreate(Landroid/content/Context;)Landroidx/window/layout/WindowInfoTracker; in class Landroidx/window/layout/WindowInfoTracker; or its super classes (declaration of 'androidx.window.layout.WindowInfoTracker' appears in /data/app/~~AxLXxhghsW6YwIzG6hpdGA==/com.wv.flutter_zoom_example-Ykq4S6cPZqNW2ZXVe0DugA==/base.apk) E/AndroidRuntime(12097): at com.zipow.videobox.conference.ui.ZmConfActivity.onCreate(ZmConfActivity.java:35)

craigspicer commented 6 months ago

Hi @zoualfkar15 please make sure to build in release mode. This is a known issue with debug builds at present. flutter run --release

zoualfkar15 commented 6 months ago

Thank youoooooooo!! @craigspicer its works fine.