Invitations
This section explains how we can subscribe to invitation events
We need an InvitationEventDelegate
to receive invitations events
let delegate = InvitationEventDelegateExample()
SippoClient.client.invitations.delegate = delegate
class InvitationsEventDelegateExample: InvitationsEventDelegate {
func invitations(_ invitations: Invitations, didCancelInvitationRequest: String) {
}
/*:
Here we received an invitation to a new conference, we can accept with join or use `Invitations`passed as argument
to decline it
*/
func invitations(_ invitations: Invitations, didReceiveConference: SippoConference) {
/*:
In join action we can pass the media that we want to share, or pass nil to use invitation media,
(this is the media that the caller use for the invite)
*/
didReceiveConference.join(for: [.video]) { task in
// Check task
}
/*:
Decline example
*/
didReceiveConference.declineInvitation { task in
}
}
func invitations(_ invitations: Invitations, didReceiveInvitationRequest: InvitationRequest) {
}
}
To receive events related to this conference it’s needed to set a delegate
didReceiveConference.delegate = aDelegate