opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
209 stars 155 forks source link

IOS is showing error when entering the opentok session #757

Closed akmal-k closed 2 weeks ago

akmal-k commented 3 weeks ago

Please post usage questions or broader discussions on StackOverflow.


For feature requests, please fill out the feature request template opentok version -> 2.27.5 Facing this issue when entering the video call in ios


For bug reports, please fill out the bug report issue template IMG_0985

jeffswartz commented 3 weeks ago

We are working on a fix for this.

akmal-k commented 3 weeks ago

We are working on a fix for this.

Thank you for reply. I think I found one more issue related to this version

In this part /node_modules/opentok_react_native/ios/OTSessionManager.swift

let streamInfo gives error to change it as var streamInfo,. The IOS build is giving error on Xcode, if I fix it locally and build it works but its not building on production

`extension OTSessionManager: OTPublisherDelegate { func publisher(_ publisher: OTPublisherKit, streamCreated stream: OTStream) { OTRN.sharedState.publisherStreams.updateValue(stream, forKey: stream.streamId) OTRN.sharedState.subscriberStreams.updateValue(stream, forKey: stream.streamId) let publisherId = Utils.getPublisherId(publisher as! OTPublisher); if (publisherId.count > 0) { OTRN.sharedState.isPublishing[publisherId] = true; let streamInfo: Dictionary<String, Any> = EventUtils.prepareJSStreamEventData(stream); streamInfo["publisherId"] = publisherId; self.emitEvent("publisherStreamCreated", data: streamInfo); setStreamObservers(stream: stream, isPublisherStream: true) } printLogs("OTRN: Publisher Stream created") }

func publisher(_ publisher: OTPublisherKit, streamDestroyed stream: OTStream) {
    OTRN.sharedState.streamObservers.removeValue(forKey: stream.streamId)
    OTRN.sharedState.publisherStreams.removeValue(forKey: stream.streamId)
    OTRN.sharedState.subscriberStreams.removeValue(forKey: stream.streamId)
    let publisherId = Utils.getPublisherId(publisher as! OTPublisher);
    OTRN.sharedState.isPublishing[publisherId] = false;
    if (publisherId.count > 0) {
        OTRN.sharedState.isPublishing[publisherId] = false;
        let streamInfo: Dictionary<String, Any> = EventUtils.prepareJSStreamEventData(stream);
        streamInfo["publisherId"] = publisherId;
        self.emitEvent("publisherStreamDestroyed", data: streamInfo);
    }
    OTRN.sharedState.publishers[publisherId] = nil;
    OTRN.sharedState.isPublishing[publisherId] = nil;
    guard let callback = OTRN.sharedState.publisherDestroyedCallbacks[publisherId] else {
        printLogs("OTRN: Publisher Stream destroyed")
        return
    };
    callback([NSNull()]);
    printLogs("OTRN: Publisher Stream destroyed")
}`
akmal-k commented 3 weeks ago

We are working on a fix for this.

Thank you for reply. I think I found one more issue related to this version

In this part /node_modules/opentok_react_native/ios/OTSessionManager.swift

let streamInfo gives error to change it as var streamInfo,. The IOS build is giving error on Xcode, if I fix it locally and build it works but its not building on production

`extension OTSessionManager: OTPublisherDelegate { func publisher(_ publisher: OTPublisherKit, streamCreated stream: OTStream) { OTRN.sharedState.publisherStreams.updateValue(stream, forKey: stream.streamId) OTRN.sharedState.subscriberStreams.updateValue(stream, forKey: stream.streamId) let publisherId = Utils.getPublisherId(publisher as! OTPublisher); if (publisherId.count > 0) { OTRN.sharedState.isPublishing[publisherId] = true; let streamInfo: Dictionary<String, Any> = EventUtils.prepareJSStreamEventData(stream); streamInfo["publisherId"] = publisherId; self.emitEvent("publisherStreamCreated", data: streamInfo); setStreamObservers(stream: stream, isPublisherStream: true) } printLogs("OTRN: Publisher Stream created") }

func publisher(_ publisher: OTPublisherKit, streamDestroyed stream: OTStream) {
    OTRN.sharedState.streamObservers.removeValue(forKey: stream.streamId)
    OTRN.sharedState.publisherStreams.removeValue(forKey: stream.streamId)
    OTRN.sharedState.subscriberStreams.removeValue(forKey: stream.streamId)
    let publisherId = Utils.getPublisherId(publisher as! OTPublisher);
    OTRN.sharedState.isPublishing[publisherId] = false;
    if (publisherId.count > 0) {
        OTRN.sharedState.isPublishing[publisherId] = false;
        let streamInfo: Dictionary<String, Any> = EventUtils.prepareJSStreamEventData(stream);
        streamInfo["publisherId"] = publisherId;
        self.emitEvent("publisherStreamDestroyed", data: streamInfo);
    }
    OTRN.sharedState.publishers[publisherId] = nil;
    OTRN.sharedState.isPublishing[publisherId] = nil;
    guard let callback = OTRN.sharedState.publisherDestroyedCallbacks[publisherId] else {
        printLogs("OTRN: Publisher Stream destroyed")
        return
    };
    callback([NSNull()]);
    printLogs("OTRN: Publisher Stream destroyed")
}`

@jeffswartz Is there any solution for this issue?

beHaze commented 2 weeks ago

Hi @akmal-k this fix is actually live now in version 2.27.6

akmal-k commented 2 weeks ago

Hi @akmal-k this fix is actually live now in version 2.27.6

Hello @beHaze, thank you!