Popin iOS SDK v2 – Integration Documentation

PopinCall is an iOS library that enables seamless integration of video calling functionality into your iOS applications. It provides an easy-to-use interface for connecting users with experts or support agents with robust real-time communication.


Requirements

  • iOS 15.0+

  • Swift 5.0+

  • Xcode 14.0+


Installation

Swift Package Manager

Add PopinCall as a dependency in your Package.swift:

dependencies: [
    .package(url: "https://github.com/AshwinDotMe/Popin-Library-iOS.git", from: "1.0.0")
]

Or in Xcode:

  1. Go to File > Add Package Dependencies...

  2. Enter the package URL: https://github.com/AshwinDotMe/Popin-Library-iOS.git

  3. Select the version you want to use.


Permissions

Add the following to your Info.plist:

Background Modes

Enable these Background Modes in your app's Signing & Capabilities:

  • Audio, AirPlay, and Picture in Picture – For audio/video streaming during calls

  • Voice over IP – For VoIP call handling

  • Background fetch – For downloading content from the network

Or add directly to your Info.plist:


Quick Start

1. Import the Library

2. Initialize with Configuration

3. Start a Call

4. Implement Listeners


Runtime Configuration Updates

You can update meta, callerId, and product before starting a call, without reinitializing the SDK:


Incoming Calls via PushKit

The SDK handles PushKit internally; you do not need to implement PKPushRegistryDelegate.

Step 1: Enable Incoming Calls

Step 2: Initialize Popin in AppDelegate

Step 3: Register for VoIP Pushes Early

Important: On iOS, PushKit requires reporting a CallKit call for every VoIP push. The SDK handles this automatically.


API Reference

Popin

  • Popin.initialize(token: String, config: PopinConfig) – Initialize the SDK

  • Popin.shared?.startCall() – Start a call

  • Popin.shared?.cancelCall() – Cancel waiting for call acceptance

  • Popin.shared?.setGroup(identifier:onSuccess:onFailure:) – Set user group

  • Popin.shared?.getConfig() – Access current configuration

  • Popin.registerForVoIPPushes() – Register for PushKit

  • Popin.deinitialize() – Logout user and deinitialize SDK


PopinProduct


Listeners

PopinInitListener

Method
Description

onInitComplete(userId:)

Initialization succeeded

onInitFailed(reason:)

Initialization failed

PopinEventsListener

Method
Description

onPermissionGiven()

Camera/mic permissions granted

onPermissionDenied()

Camera/mic permissions denied

onCallStart()

Call queued

onCallAbandoned()

Call abandoned during connecting screen

onQueuePositionChanged(position:)

Queue position changed

onCallMissed()

No agent answered

onCallNetworkFailure(participant:)

Network error occurred

onCallConnected()

Call active

onCallFailed()

Call failed

onCallEnd()

Call ended

Last updated