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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zoom Version SDK is to be low

ShirishModi8 opened this issue · comments

flutter_zoom_sdk: ^1.1.0+4

any sloution how to update

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.

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 ?

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

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 ?

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

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;

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

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

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

any updates on this issue ?

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

Yep, both.

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

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.

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.

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.

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.

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.

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.

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.

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
Hi,
what about appKey and appSecret
its does not exist ?
please answer me ASAP
thanks

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

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

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).

@craigspicer
@suhailzoft
can you help me please

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 It's only the JWT app type that has been deprecated. The meeting SDK must still be initialised with a JWT signature.

@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

@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

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)

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

Thank youoooooooo!!
@craigspicer its works fine.