AgoraIO-Usecase / Video-Calling

Calling Interface + Connection Service on top of Agora RTM + RTC for Video Calling Example
MIT License
60 stars 43 forks source link

Not getting audio/video call when app not running or background mode #47

Open GireshD opened 1 year ago

GireshD commented 1 year ago

Currently I am using Agora SDK for Audio/Video call. I am not getting call when app is not running. What I need to added to get audio/video call in background or app not running.

plutoless commented 1 year ago

you will need to add voip/push notification capabilities yourself in this case.

GireshD commented 1 year ago

@plutoless I tried with VOIP push notification but my app crashed when I accepted the call.

my app crashed here, showing empty lastIncomingInvitation, as I got call from VOIP push notification. guard let last = rtm.lastIncomingInvitation else { fatalError("rtm lastIncomingInvitation") }

code: func accpetLastIncomingInvitation(fail: ErrorCompletion = nil) { let rtm = AgoraRtm.shared()

    guard let last = rtm.lastIncomingInvitation else {
        fatalError("rtm lastIncomingInvitation")
    }

    accept(last) {(errorCode) in
        guard errorCode == AgoraRtmInvitationApiCallErrorCode.ok else {
            if let fail = fail {
                fail(AGEError(type: .fail("rtm refuse invitation fail: \(errorCode.rawValue)")))
            }
            return
        }
    }
}

please help me on this

plutoless commented 1 year ago

@GireshD it seems it's trying to get the variable here image

could you pls set a breakpoint to see why it's returning nil?