Platform

Platform

  • Getting Started
  • API

›Android 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, Iris 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

Login via CIMA token involves following steps:

  1. Give the registered user Id and password to login.
  2. Using app token generated from app key & app secret key, make a request to the 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":"<mediaToken>","access_type":"offline","scope":"mappings"}

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

Response:
  200 OK https://aum.iris.comcast.net/v1.1/login
  Content-Type: application/json
  Trace-Id: <trace id>
Responsebody:
  {"expires_in":"<expirytime>","id":"<user_id>","idmapping_count":<count>,"refresh_token":"<refreshToken>","routing_id":"<routing_id of registered user>","token":"<iris token for authentication>","user_data":{"cust_guid":"<customer guid>","email":"<registered_email_id>"}}
  1. Using the token received in the previous Auth Manager response, request the Identity manager for 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":["<userEmailId>","<pstn_number>","<registeredId>"],"routing_id":"<routingId of registered user>"}

Anonymous Login

Iris platform allows non-registered users to connect anonymously to the server, to perform a video call or chat.
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.
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":"<anonymous user id>"}

The response for successful request for anonymous login is as:

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

Establish RTC connection

A successful RTC (websocket) connection is required for a participant to initiate or join a room, using IrisRtcConnection class. Since IrisRtcConnection is a singleton class, the following function is used to get the current instance of IrisRtcConnection & avoid creation of multiple instances.

  IrisRtcConnection IrisRtcConnection.getInstance();

Call this connect API to generate the xmpp server info (url/token/timestamp), which is used to connect to the RTC server.

  void connect(String serverUrl, String irisToken, String routingId, final IrisRtcConnectionObserver observer, Context context, boolean anonymousLogin)
Parameters
serverUrlEvent Manager URL to get the RTC server info
irisTokenjson web token for event manager REST call
routingIdUser's routing Id from Identity manager.
observerListener to receive the callbacks for Rtc connection upon completion or failure of the operation..
contextApplication context
anonymousLogin(Optional) - Set user type to true for anonymous user; Default - false.
  ... 
  ... 
  IrisRtcConnection.getInstance().connect(serverUrl, irisToken, routingId, observer, context, false);
  ... 
  ... 

Disconnect from RTC Connection

To disconnect from RtcConnection, use

  void disconnect();

For example,

  ... 
  ... 
  IrisRtcConnection.getInstance().disconnect();
  ... 
  ... 

Callbacks for RTC Connection

onConnected

This callback is called when the connection is established/successful.

    void onConnected();

onDisconnect

This callback is called when the connection is disconnected.

   void onDisconnect();

onError

This callback is called when there is an error.

     void onError(WebRTCError.ErrorCode error, JSONObject additionalInfo);
Parameters
errorThe basic error code details
additionalInfoAdditional error details including description.

onNotification

This callback is called when notification is received for this RTC connection instance.

     void onNotification(IrisNotificationPayload irisNotificationPayload);
Parameters
irisNotificationPayloadNotification payload

onReconnecting

This callback is called when trying reconnection

     void onReconnecting();
← 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