nttcom / SkyWay-iOS-Sample

[Deprecated] Sample application of SkyWay iOS SDK
16 stars 11 forks source link

Problem when implementing incoming call #18

Open TaoufikBouabid opened 6 years ago

TaoufikBouabid commented 6 years ago

Hi, Thank you for your amazing project. I'm developing an app which contains incoming call, so when a new call is received the event 'PEER_EVENT_CALL' is triggered, in callback I present the incoming call view controller and pass the obj as parameter,

peer.on(SKWPeerEventEnum.PEER_EVENT_CALL) { (obj) in
            if obj is SKWMediaConnection {
                let stb = UIStoryboard.init(name: "VideoCall", bundle: nil)
                let incomingCall = stb.instantiateViewController(withIdentifier: "InconmingCallViewController") as! InconmingCallViewController
                incomingCall.delegate = self
                incomingCall.obj = obj as! SKWMediaConnection
                self.present(incomingCall, animated: true, completion: nil)
            }
        }

when I press the accept button , I answer the call and setMediacallback to send local stream ,

extension VideoCallViewController: IncomingCallViewControllerDelegate {
    func didAccept(_ obj: SKWMediaConnection) {
        self.mediaConnection = obj
        self.mediaConnection.answer(msLocal)
        self.setMediaCallbacks(self.mediaConnection)
    }
}

my problem is the media connection event stream is not triggered 'MEDIACONNECTION_EVENT_STREAM' so I'm unable to send

media.on(SKWMediaConnectionEventEnum.MEDIACONNECTION_EVENT_STREAM) { (obj) in
            //Add Stream
            if obj is SKWMediaStream {
                self.remote = obj as! SKWMediaStream
                self.settRemoteView(self.remote)
            }
        }

P.S: when I set the media connection under call event , it works but I need incoming call screen

peer.on(SKWPeerEventEnum.PEER_EVENT_CALL) { (obj) in
            if obj is SKWMediaConnection {
        self.mediaConnection = obj
        self.mediaConnection.answer(msLocal)
        self.setMediaCallbacks(self.mediaConnection)
            }
        }
ykws commented 6 years ago

@TaoufikBouabid This repository has been deprecated. Please see the new sample https://github.com/skyway/skyway-ios-sdk-tutorial Thanks.