Skip to content

Users & Telepresence

hermanShai edited this page Oct 23, 2019 · 20 revisions

Overview

In this page we will outline all the SDK methods that are related to temi users and telepresence. temi users are people who have a temi account, this means they have downloaded the mobile app, registered and that now you can call them from temi.


Applications

  1. To fetch all the temi contacts use the method getAllContact().
  2. To get information on the temi's admin use the method getAdminInfo().
  3. To listen for user info changes add OnUsersUpdatedListener using the addOnUsersUpdatedListener
  4. To stop listening for user info changes remove the listener using the removeOnUsersUpdatedListener()
  5. To start a call use the method startTelepresence().
  6. To listen for telepresence statuses add OnTelepresenceStatusChangedListener using the addOnTelepresenceStatusChangedListener
  7. To stop listening for telepresence statuses remove the listener using the removeOnTelepresenceStatusChangedListener()

Methods

Below are the details regarding the users and telepresence methods you can use from SDK.

◆ Get All Contacts

com.robotemi.sdk.Robot.getAllContact ( ) List<UserInfo>

Use this method fetch all the temi contacts that are synced with the launcher. These contacts are saved on the admin's mobile device and are registered to the temi service.

Returns
  • A list of contacts with their relevant user information in a List<UserInfo>
  • Exceptions
    RemoteException getAllContacts() error

    ◆ Get Admin Info

    com.robotemi.sdk.Robot.getAdminInfo ( ) UserInfo

    Use this method temi's admin user information, this information can be used for many things but mainly it's useful to make calls from temi to the admin's mobile device.

    Returns
  • An object of type UserInfo that contains the admin's user information
  • Exceptions
    RemoteException getAdminInfo() error

    ◆ Start a Call

    com.robotemi.sdk.Robot.startTelepresence ( String  displayName
    String  peerId
    )
    String

    Use this method to initiate a telepresence session using the temi telepresence service to one of the admin's temi contacts.

    Parameters
    displayName String value of the name of the person you want to call.
    peerId String value of the id of the person you want to call.
    *Note: You can get the list on contacts by using the method getAllContact(). The list is composed of UserInfo objects which hold the name and peerId
    Returns
  • A String which is the session Id of the call
  • Exceptions
    RemoteException startCall() error

    Listeners

    Below are the details regarding how to listen for user and telepresence status changes.

    ◆ User Info Listener

    com.robotemi.sdk.Robot.addOnUsersUpdatedListener ( OnUsersUpdatedListener  listener
    )
    void

    Use this method to add a listener for temi's admin contact changes. Every time one of the admin's contacts makes a change to his info, or is added or deleted from the contact's list the listener will be triggered.

    Parameters
    listener A listener object of type OnUsersUpdatedListener that contains a void method onUserUpdated(final UserInfo user) which is triggered every time one of the admin's contacts makes a change to his info, or is added or deleted from the contact's list with the contact info
    Returns
    void object.

    ◆ Remove User Info Listener

    com.robotemi.sdk.Robot.removeOnUsersUpdatedListener ( OnUsersUpdatedListener  listener
    )
    void

    Use this method to remove a specific listener for temi user info changes

    Parameters
    listener The OnUsersUpdatedListener that you wish to remove from the list of user info changes listeners registered
    Returns
    void object.

    ◆ Telepresence Status Listener

    com.robotemi.sdk.Robot.addOnTelepresenceStatusChangedListener ( OnTelepresenceStatusChangedListener  listener
    )
    void

    Use this method to add a listener for telepresence status changes. By adding this listener you will mainly know if the call has started, ended or declined.

    Parameters
    listener A listener object of type OnTelepresenceStatusChangedListener that contains a void method onTelepresenceStatusChanged(CallState callState) which is triggered whenever there's a change to the telepresence status with an object that contains information on that object.
    Returns
    void object.

    ◆ Remove Telepresence Status Listener

    com.robotemi.sdk.Robot.removeOnTelepresenceStatusChangedListener ( OnTelepresenceStatusChangedListener  listener
    )
    void

    Use this method to remove a specific listener for temi telepresence status changes

    Parameters
    listener The OnTelepresenceStatusChangedListener that you wish to remove from the list of telepresence status changes listeners registered
    Returns
    void object.

    Models

    Below are the details regarding models used in the methods above

    ◆ User Info

    com.robotemi.sdk.UserInfo ( String  userId
    String  name
    String  picUrl
    int  role
    )

    Object used to hold information regarding temi contacts

    Attributes
    userId String Unique id for the contact
    name String The name the user has registered himself with on the temi service
    picUrl String A url to contact's temi profile image
    role int The role of the contact in relation to the temi (0=Admin, 1=Member, 2=Regular Contact)

    ◆ Call State

    com.robotemi.sdk.telepresence.CallState ( String  sessionId
    State  state
    )

    Object used to hold information regarding the state of the telepresence session

    Attributes
    sessionId String Unique id for the telepresence call
    state State State is an enum which holds three values:
  • ENDED - A call has ended
  • DECLINED - A call attempt was declined by the other callee
  • STARTED - Call was accepted by the callee and has started
  • Clone this wiki locally