ZEGOCLOUD / zego_uikit_prebuilt_call_flutter

MIT License
16 stars 15 forks source link

after updating from 3.16 to 4.2.2 i am havingthis please help me fix #35

Closed fisforfaheem closed 7 months ago

fisforfaheem commented 7 months ago

ZegoUIKitPrebuiltCall( appID: 2123453149, appSign: 'dsadasdasdasd', userID: AuthProvider.getUserDetails().email, userName: AuthProvider.getUserDetails().displayName, callID: model.channelNAme, config: ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall() ..onOnlySelfInRoom = (context) { model.onDisconnect(context); } ..onHangUp = () => model.onDisconnect(context)

Screenshot 2024-03-12 at 5 05 04 PM
yoer commented 7 months ago

https://pub.dev/documentation/zego_uikit_prebuilt_call/latest/topics/Migration_v4.x-topic.html#onhangupononlyselfinroomonmeremovedfromroom

You can refer to this migration guide, which has detailed migration steps.

yoer commented 7 months ago
ZegoUIKitPrebuiltCall(
    ...
    events: ZegoUIKitPrebuiltCallEvents(
      onCallEnd: (
          ZegoCallEndEvent event,

          /// defaultAction to return to the previous page
          VoidCallback defaultAction,
          ) {
        model.onDisconnect(context);
      },
    ),
  );
fisforfaheem commented 7 months ago

I can't understand that, kindly help me with this

On Thu, Mar 14, 2024, 12:04 PM yoer @.***> wrote:

ZegoUIKitPrebuiltCall( ... events: ZegoUIKitPrebuiltCallEvents( onCallEnd: ( ZegoCallEndEvent event,

      /// defaultAction to return to the previous page          VoidCallback defaultAction,
      ) {
    model.onDisconnect(context);
  },
),

);

— Reply to this email directly, view it on GitHub https://github.com/ZEGOCLOUD/zego_uikit_prebuilt_call_flutter/issues/35#issuecomment-1996694790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSDHNETCSP26GMBFYK3YYFDYVAVCNFSM6AAAAABESDAL32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGY4TINZZGA . You are receiving this because you authored the thread.Message ID: @.*** com>

yoer commented 7 months ago

move your code inonHangUp and onOnlySelfInRoom from config to events in ZegoUIKitPrebuiltCall

yoer commented 7 months ago

before:

 ZegoUIKitPrebuiltCall(
     ...
     config: ZegoUIKitPrebuiltCallConfig(
       onHangUp: () {
         model.onDisconnect(context);
       },
       onOnlySelfInRoom: () {
         model.onDisconnect(context);
       },
     ),
   );

after:

 ZegoUIKitPrebuiltCall(
     ...
     events: ZegoUIKitPrebuiltCallEvents(
       onCallEnd: (
           ZegoCallEndEvent event,

           /// defaultAction to return to the previous page          VoidCallback defaultAction,
           ) {
         model.onDisconnect(context);
       },
     ),
   );
fisforfaheem commented 7 months ago

what about : ..onOnlySelfInRoom = (context) { model.onDisconnect(context); }

and

..onHangUp = () => model.onDisconnect(context)

            onDispose: () => model.onDisconnect(context),

currently i have done this only: events: ZegoUIKitPrebuiltCallEvents(onCallEnd: ( ZegoCallEndEvent event,

          /// defaultAction to return to the previous page
          VoidCallback defaultAction,
        ) {
            model.onDisconnect(context);
          debugPrint('onCallEnd, do whatever you want');

          /// you can call this defaultAction to return to the previous page,
          defaultAction.call();
        }
fisforfaheem commented 7 months ago
image
fisforfaheem commented 7 months ago

how to use this: ..onOnlySelfInRoom = (context) { // model.onDisconnect(context); // }

yoer commented 7 months ago
/// The default behavior is to return to the previous page.
///
/// If you override this callback, you must perform the page navigation
/// yourself to return to the previous page!!!
/// otherwise the user will remain on the current call page !!!!!
enum ZegoCallEndReason {
  /// the call ended due to a local hang-up
  localHangUp,

  /// the call ended when the remote user hung up, leaving only one local user in the call
  remoteHangUp,

  /// the call ended due to being kicked out
  kickOut,
}

when event.reason is ZegoCallEndReason.remoteHangUp, that's mean onOnlySelfInRoom


ZegoUIKitPrebuiltCall(
  events: ZegoUIKitPrebuiltCallEvents(
    onCallEnd: (
      ZegoCallEndEvent event,

      /// defaultAction to return to the previous page
      VoidCallback defaultAction,
    ) {
      model.onDisconnect(context);

      defaultAction.call();

      switch (event.reason) {
        case ZegoCallEndReason.localHangUp:
          /// onHangUp
          break;
        case ZegoCallEndReason.remoteHangUp:
          /// onOnlySelfInRoom
          break;
        case ZegoCallEndReason.kickOut:
          /// onMeRemovedFromRoom
          break;
      }
    },
  ),
);