decodedhealth / flutter_zoom_plugin

Flutter plugin for zoom
Apache License 2.0
125 stars 83 forks source link

sdk initialization failed #63

Open shargeel071 opened 3 years ago

shargeel071 commented 3 years ago

Your Environment

import 'package:flutter_zoom_plugin/zoom_view.dart'; import 'package:flutter_zoom_plugin/zoom_options.dart';

import 'package:flutter/material.dart';

class MeetingWidget extends StatelessWidget {

ZoomOptions zoomOptions; ZoomMeetingOptions meetingOptions;

Timer timer;

MeetingWidget({Key key, meetingId, meetingPassword}) : super(key: key) { this.zoomOptions = new ZoomOptions( domain: "zoom.us", appKey: " my key", appSecret: "using my key", ); this.meetingOptions = new ZoomMeetingOptions( userId: 'example', meetingId: meetingId, meetingPassword: meetingPassword, disableDialIn: "true", disableDrive: "true", disableInvite: "true", disableShare: "true", noAudio: "false", noDisconnectAudio: "false" ); }

bool _isMeetingEnded(String status) { var result = false;

if (Platform.isAndroid)
  result = status == "MEETING_STATUS_DISCONNECTING" || status == "MEETING_STATUS_FAILED";
else
  result = status == "MEETING_STATUS_IDLE";

return result;

}

@override Widget build(BuildContext context) { // Use the Todo to create the UI. return Scaffold( appBar: AppBar( title: Text('Loading meeting '), ), body: Padding( padding: EdgeInsets.all(16.0), child: ZoomView(onViewCreated: (controller) {

      print("Created the view");

      controller.initZoom(this.zoomOptions)
          .then((results) {

        print("initialised");
        print('follwing is result');
        print(results);

        if(results[0] == 0) {

          controller.zoomStatusEvents.listen((status) {
            print("Meeting Status Stream: " + status[0] + " - " + status[1]);
            if (_isMeetingEnded(status[0])) {
              Navigator.pop(context);
              timer?.cancel();
            }
          });

          print("listen on event channel");

          controller.joinMeeting(this.meetingOptions)
              .then((joinMeetingResult) {

            timer = Timer.periodic(new Duration(seconds: 2), (timer) {
              controller.meetingStatus(this.meetingOptions.meetingId)
                  .then((status) {
                print("Meeting Status Polling: " + status[0] + " - " + status[1]);
              });
            });

          });
        }

      }).catchError((error) {

        print("Error");
        print(error);
      });
    })
  ),
);

}

}


## Expected Behavior
<!--- Tell us what should happen -->

## Actual Behavior
<!--- Tell us what happens instead -->

## Steps to Reproduce
<!--- reproduce this issue; include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- What were you trying to do? -->

## Debug logs
<!-- include iOS / Android logs
- ios XCode logs,
- use #getLog #emailLog methods (@see docs)
- Android: $ adb logcat -s TSLocationManager
-->
<details>
    <summary>Logs</summary>

``` <!-- syntax-highligting:  DO NOT REMOVE -->
Failed to initialize Zoom SDK
I/flutter ( 9947): initialised
I/flutter ( 9947): follwing is result
I/flutter ( 9947): [2, 3023]
I/flutter ( 7817): current datetime is 2021-02-17 15:38:36.632117

ahsan1246 commented 3 years ago

MeetingWidget({Key key, meetingId, meetingPassword}) : super(key: key) { this.zoomOptions = new ZoomOptions( domain: "zoom.us", appKey: " my key", <-------- appSecret: "using my key", <-------- );

In this section, you have to provide your own zoom app key and secret. First, you have to create your application on zoom by clicking on the marketplace. inside the marketplace, you have to be select the application type. The application type should be SDK. After creating the application successfully, on the left side of the page, there is an app credentials option. Inside this, there is an appKey and appSecret. You have to use this.