opentok-ios-sdk-samples-swift icon indicating copy to clipboard operation
opentok-ios-sdk-samples-swift copied to clipboard

app crash when call session?.disconnect(&error)

Open mhdHasanAlgnadi opened this issue 3 years ago • 7 comments

I setup everything and do a video call and everything is fine but when I try to disconnect the session the app crash and send this error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM longLongValue]: unrecognized selector sent to instance 0x283e4c080' I use sdk 2.20.0 on flutter app

mhdHasanAlgnadi avatar Jun 24 '21 09:06 mhdHasanAlgnadi

did you get any solution for that I am also stuck on this issue?

adil-nangyal avatar Jan 25 '22 13:01 adil-nangyal

Same problem here, it happens also on 2.21.2 and 2.21.3

fabiocody avatar Feb 04 '22 16:02 fabiocody

Hello @mhdHasanAlgnadi @fabiocody did you find a resolution to this issue? Thanks.

dweberlj avatar Oct 05 '22 21:10 dweberlj

I honestly didn't even remember about this error, all I can say is that everything is working fine with latest OpenTok and Flutter versions. Are you still having this issue?

fabiocody avatar Oct 05 '22 21:10 fabiocody

Hi @fabiocody, I'm using opentok 2.21.3 and in my flutter (v3) app I open a new route (page) to display the video from my main menu. That works, when I navigate back to my main menu (Navigator.of(context).pop()) I get this error.

When I use the latest opentok 2.23.1 I get a crash when opentok starts. My opentok code is based on this example https://pub.dev/packages/flutter_vonage_video/example

What versions of Flutter and opentok are you using or maybe you're not using Flutter and writing a native iOS app instead?

Thanks!

dweberlj avatar Oct 05 '22 21:10 dweberlj

I'm using Flutter 3.3.3 and OpenTok 2.23.1. My code is based on this example https://github.com/opentok/opentok-flutter-basic-video-chat

fabiocody avatar Oct 05 '22 22:10 fabiocody

Correction, that is the code base that I'm using too.

Did you have to modify the main.dart code for Flutter v3? I had to change add Platform.Android check and use PlatformViewSurface for iOS.

https://github.com/opentok/opentok-flutter-basic-video-chat/blob/a055399aaa15055e5eca6126ce44b81e40c8dfec/lib/main.dart#L166-L171

            child: PlatformViewLink(
              viewType: 'opentok-video-container', // custom platform-view-type
              surfaceFactory: (BuildContext context, PlatformViewController controller) {
                if (Platform.isAndroid) {
                  return AndroidViewSurface(
                    controller: controller,
                    gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
                    hitTestBehavior: PlatformViewHitTestBehavior.opaque,
                  );
                } else {
                  return PlatformViewSurface(
                    controller: controller,
                    gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
                    hitTestBehavior: PlatformViewHitTestBehavior.opaque,
                  );
                }
              },

dweberlj avatar Oct 05 '22 23:10 dweberlj