Platform

Platform

  • Getting Started
  • API

›IOS SDK

Getting Started

  • Create Your App

Quick Starts

  • 555 Samples

Mobile SDK (v1.0)

  • Overview
  • IOS SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept video call
    • How to set log level for SDK
    • Release Notes

    Android SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept video call
    • How to set log level for SDK
    • Release Notes

Mobile SDK (v2.0)

  • Overview
  • IOS SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to initiate or accept VIDEO call
    • How to initiate or join ANONYMOUS VIDEO call
    • Release Notes
    • Reference code - How to initiate or accept PSTN Call
    • Reference code - How to initiate or accept Video Call
    • Reference code - How to initiate or join Anonymous Video Call

    Android SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • How to intiate or accept Video Call
    • How to intiate or accept ANONYMOUS VIDEO Call
    • Release Notes
    • Reference code - How to initiate or accept PSTN Call
    • Reference code - How to initiate or accept Video Call
    • Reference code - How to initiate or join Anonymous Video Call

    React Native SDK

    • Getting started
    • Installation Guide
    • How to do user authentication
    • How to subscribe for notifications
    • How to initiate or accept PSTN call
    • Release Notes

WebRTC JS SDK

  • Overview
  • Getting Started
  • How to do user authentication
  • How to subscribe for notifications
  • How to initialize SDK
  • How to initiate or accept PSTN call
  • How to initiate or accept video call
  • How to create a screen share session
  • Release Notes

User Authentication

Login to 555

Currently, 555 platform provides various types of authentication like login through email, facebook, CIMA token. In this document, let us look into the below options:

  • Login via CIMA token
  • Anonymous Login

Once the user is logged in, next step is to establish RTC connection

Login via CIMA Token

  • Give the registered user Id and password to login.

  • Using app token generated from app key & app secret key, make request to Auth manager for a valid token.

    Request:
      HTTP POST https://aum.iris.comcast.net/v1.1/login http/1.1
    Headers:
      Content-Type: application/json; charset=utf-8
      Content-Length: <length>
      Authorization: Basic <App token>
      User-Agent: <App name>/<App version><space><System http agent>
    Requestbody:
      {"type":"Cima","media_token":"<media token>","access_type":"offline","scope":"mappings"}
    

    The Token that is received in the response, is a short-lived credential generated by server to authenticate the user. Response to a successful login request is given below:

    Response:
      200 OK https://aum.iris.comcast.net/v1.1/login
      Content-Type: application/json
      Trace-Id: <trace id>
    Responsebody:
      {"expires_in":"<expires in>","id":"<id>","idmapping_count":<id mapping count>,"refresh_token":<refresh token>,"routing_id":"<routing id of the registered user>","token": <token for authentication>,"user_data":{"cust_guid":"<cust_guid>","email":"<Registered email id>"}}
    
  • Using the token received in the Auth Manager response, make a request to the Identity manager to get the public id's of the user. Public Id's are the unique Id's provide to each registered user.

    Request:
      HTTP GET https://idm.iris.comcast.net/v1/allidentities http/1.1
      Authorization: Bearer <token>
      User-Agent: <App name>/<App version><space><System http agent>
    

    A successful request will give us the following details as response:

    Response:
      200 OK https://idm.iris.comcast.net/v1/allidentities
      Content-Type: application/json
    Responsebody:
      {"public_ids":["<user email id>","<pstn number>","<registered id>"],"routing_id":"<routing id of the registered user>"}""]]
    

Anonymous Login

IOS SDK gives an option for the non-registered users to connect anonymously to the server.

  • Two parameters are required to join a room anonymously

    • Room name: Name of the room to which user wants to join
    • User name: Name of the user who is joining the room.
  • Using app token generated from app key & app secret key, make a request to Auth manager for a valid token.

    Request:
      POST https://aum.iris.comcast.net/v1.1/login/anonymous http/1.1
      Content-Type: application/json; charset=utf-8
      Content-Length: 17
      Authorization: Basic <app token>
    Requestbody:
      {"user_id":"<user name >"}
    

    The Token that is received as the response, is a short-lived credential generated by server to authenticate the user. Response to a successful login request is given below:

    Response:
      200 OK https://aum.iris.comcast.net/v1.1/login/anonymous
      Content-Type: application/json
      Trace-Id: <trace id>
      {"token":"<token for authentication>"}
    

Establish RTC Connection

A successful RTC(websocket) connection is required for a participant to initiate or join a room. IrisRtcConnection class is used to manage the connection with IRIS backend. It also involves making the necessary REST API calls with event manager and other components to get the resources required for the connection. The idea of this class is to keep a persistent connection with IRIS backend and hence it is a good practice to create the connection when app goes to foreground and disconnect when the app goes to background.

Since IrisRtcConnection is a singleton class, the following function is used to get the current instance of IrisRtcConnection & avoid creation of multiple instances.

(IrisRtcConnection *)sharedInstance;

For example,

let connection = IrisRtcConnection.sharedInstance()

Invoke connectUsingServer API to establish RTC connection with the IRIS backend:

(BOOL)connectUsingServer:(NSString* )serverUrl irisToken:(NSString*)irisToken routingId:(NSString*)routingId delegate:(id _Nullable)delegate error:(NSError* _Nullable *)outError;
Parameters
serverUrlThe event manager URL
irisTokenA valid IRIS token from Auth manager
routingIdRouting ID of the user from Identity manager
delegateThe delegate object for IrisRtcConnection
outErrorProvides error code and basic error description when any exception occured in api call

let connection = IrisRtcConnection.sharedInstance()
weak var connectionDelegate = self

// attempt a connection
connection.connect(usingServer: serverUrl,
                   irisToken: jwtToken,
                   routingId:routingId,
                   delegate:connectionDelegate)

Disconnect from RTC Connection

The connection that is made with the IRIS backend can be disconnected using the following API.

(void)disconnect;

For example,

IrisRtcConnection.sharedInstance().disconnect()

Callbacks for RTC Connection

The IrisRtcConnectionDelegate protocol defines the optional methods implemented by delegates of the IrisRtcConnection class.

onConnected

This callback gets invoked when the connection is established successfully.

(void)onConnected;

onReconnecting

This method is called when the RTC connection is reconnecting.

(void)onReconnecting;

onDisconnected

This callback confirms disconnection from RTC server.

(void)onDisconnected;

onError

This callback gets invoked when an error occure in RTC connection.

(void)onError:(NSError *)error withAdditionalInfo:(nullable NSDictionary *)info;
Parameters
errorThe basic error code details
infoAdditional error details including description

onNotification

This callback gets invoked when notification is received for RTC connection instance.

(void)onNotification:(NSDictionary *)data;
Parameters
irisNotificationPayloadNotification payload
← Installation GuideHow to subscribe for notifications →
  • Login to 555
    • Login via CIMA Token
    • Anonymous Login
  • Establish RTC Connection
    • Callbacks for RTC Connection
Docs
Getting StartedGuidesAPI Reference
More
BlogGitHub
555 Platform
Copyright © 2024 555 Platform ™
555docs-v0.0.94