connectycube_sdk
library
Functions
addMessageReaction (String messageId , String reaction )
→ Future <void >
Adds the reaction on the message with messageId
messageId
- the ID of the message you reacted on
reaction
- the reaction you want to add
addRemoveAdmins (String dialogId , {Set <int > ? toAddIds , Set <int > ? toRemoveIds })
→ Future <CubeDialog >
convertCubeItemToXmpp (CubePrivacyListItem cubeItem , int order , bool inGroup )
→ PrivacyListItem
createCustomObject (CubeCustomObject customObject )
→ Future <CubeCustomObject >
Returns created object
createDialog (CubeDialog newDialog )
→ Future <CubeDialog >
createEvent (CubeEvent event )
→ Future <List <CubeEvent > >
event
- new event to creation. Use class-helper CreateEventParams ] to simple creation of new instance of event
createLocalMediaStream (String label )
→ Future <MediaStream >
createMeeting (CubeMeeting meeting )
→ Future <CubeMeeting >
Creates new CubeMeeting
model on the backend.
More details about required parameters by link
createMessage (CubeMessage message , [bool sendToChat = false ])
→ Future <CubeMessage >
createPeerConnection (Map <String , dynamic > configuration , [Map <String , dynamic > constraints = const {} ])
→ Future <RTCPeerConnection >
createSession ([CubeUser ? cubeUser ])
→ Future <CubeSession >
createSessionUsingFirebase (String projectId , String accessToken )
→ Future <CubeSession >
createSessionUsingFirebaseEmail (String projectId , String accessToken )
→ Future <CubeSession >
createSessionUsingFirebasePhone (String projectId , String accessToken )
→ Future <CubeSession >
createSessionUsingSocialProvider (String socialProvider , String accessToken , [String ? accessTokenSecret ])
→ Future <CubeSession >
createSubscription (Map <String , dynamic > params )
→ Future <List <CubeSubscription > >
params
- additional parameters for request. Use class-helper CreateSubscriptionParameters to simple config request
createWhiteboard (CubeWhiteboard whiteboard )
→ Future <CubeWhiteboard >
Creates new CubeWhiteboard
model on the backend.
More details about required parameters by link
degradationPreferenceforString (String ? degradation )
→ RTCDegradationPreference
deleteCustomObjectById (String className , String id )
→ Future <void >
className
- name of the class of custom objects which you want to delete
id
- id of custom object which you want to delete
deleteCustomObjectsByCriteria (String className , [Map <String , dynamic > ? params ])
→ Future <int >
Returns the count of deleted objects
deleteCustomObjectsByIds (String className , List <String > ids )
→ Future <DeleteItemsResult ? >
Returns DeleteItemsResult object with detailed information about deleting result
deleteDialog (String dialogId , [bool ? force ])
→ Future <void >
deleteDialogs (Set <String > dialogsIds , [bool ? force ])
→ Future <DeleteItemsResult ? >
deleteFile (int fileId )
→ Future <void >
Deletes the file with fileId
.
deleteMeeting (String id )
→ Future <void >
Deletes the meeting record by id
on the backend.
deleteMessages (List <String > messagesIds , [bool ? force ])
→ Future <DeleteItemsResult >
deleteSession ()
→ Future <void >
deleteSessionsExceptCurrent ()
→ Future <void >
deleteSubscription (int subscriptionId )
→ Future <void >
deleteUser (int userId )
→ Future <void >
deleteUserByExternalId (int externalId )
→ Future <void >
deleteWhiteboard (String whiteboardId )
→ Future <void >
Deletes the whiteboard record by whiteboardId
on the backend.
getAddressBook ([String ? udid ])
→ Future <List <CubeContact > ? >
getAllUsers ()
→ Future <PagedResult <CubeUser > ? >
getAllUsersByIds (Set <int > ids , {RequestPaginator ? paginator , RequestSorter ? sorter })
→ Future <PagedResult <CubeUser > ? >
ids
- the set of ids of users you want to get
paginator
- the instance of the helper class RequestPaginator
that is representing
the pagination parameters in the request. Note: the paginator.page
should start from 0.
sorter
- the instance of the helper class RequestSorter
that is representing
the sorting parameters in the request. The example can be var sorter = RequestSorter.desc('created_at');
getAudioConfig ({String ? deviceId })
→ dynamic
getCubeFile (int fileId )
→ Future <CubeFile >
Returns the CubeFile which was uploaded before
getCubeFiles ([Map <String , dynamic > ? params ])
→ Future <PagedResult <CubeFile > >
Returns the list of files created by the current user. The list of available
parameters provided by link https://developers.connectycube.com/server/storage?id=parameters-3
getCustomObjectById (String className , String id )
→ Future <CubeCustomObject ? >
Returns custom object with id
getCustomObjectPermissions (String className , String id )
→ Future <CustomObjectPermissionsResult >
Returns permissions for requested by id
object
getCustomObjectsByClassName (String className , [Map <String , dynamic > ? params ])
→ Future <PagedCustomObjectResult >
Returns list of requested objects
getCustomObjectsByIds (String className , List <String > ids )
→ Future <PagedCustomObjectResult >
Returns list of requested objects
getDialogIdFromGroupChatJid (Jid jid )
→ String
getDialogNotificationsSettings (String dialogId )
→ Future <bool >
getDialogOccupants (String dialogId )
→ Future <PagedResult <CubeUser > ? >
getDialogs ([Map <String , dynamic > ? params ])
→ Future <PagedResult <CubeDialog > ? >
getDialogsCount ()
→ Future <int >
getJidForGroupChat (String dialogId )
→ String
getJidForUser (int userId , [String ? resource ])
→ String
getMeetings ([Map <String , dynamic > ? params ])
→ Future <List <CubeMeeting > >
Returns meeting according to your params
More details about possible criteria of filtering by link
Note: function can return a maximum of 100 items, use getMeetingsPaged for getting more using the pagination feature
getMeetingsPaged ({int limit = 100 , int skip = 0 , Map <String , dynamic > ? params })
→ Future <PagedResult <CubeMeeting > >
Returns meetings according to your params
using the pagination feature
More details about possible criteria of filtering by link
getMessageReactions (String messageId )
→ Future <Map <String , List <int > > >
Returns reactions associated with message with messageId
Result contains the map where key is the reaction and value is the list of
users' ids who reacted with this reaction
messageId
- the ID of the message you want to get reactions
getMessages (String dialogId , [Map <String , dynamic > ? params ])
→ Future <PagedResult <CubeMessage > ? >
params
- additional parameters for request. Use class-helper GetMessagesParameters to simple config request
getMessagesCount (String dialogId )
→ Future <int >
getPrivateUrlForUid (String ? uid )
→ String ?
getPublicUrlForUid (String ? uid )
→ String
getQueryString (Map params , {String prefix = '&' , bool inRecursion = false })
→ String
Returns query parameters string, e.g.
application_id=774&auth_key=aY7WwSRmu2-GbfA&nonce=1451135156
This function is more suitable for php
API servers.
Try the getUriQueryString if the server returns errors related to the syntax of the query string
getRegisteredUsersFromAddressBook (bool compact , [String ? udid ])
→ Future <List <CubeUser > ? >
getRtpReceiverCapabilities (String kind )
→ Future <RTCRtpCapabilities >
getRtpSenderCapabilities (String kind )
→ Future <RTCRtpCapabilities >
getSession ()
→ Future <CubeSession >
getSubscriptions ()
→ Future <List <CubeSubscription > >
getUnreadMessagesCount ([List <String > ? dialogsIds ])
→ Future <Map <String , int > >
getUriQueryString (Map <String , dynamic > params )
→ String
Returns query parameters string, e.g.
application_id=774&auth_key=aY7WwSRmu2-GbfA&nonce=1451135156
The difference between this function from the getQueryString is that this one is based on the dart
specifications
getUserByEmail (String email )
→ Future <CubeUser ? >
getUserByExternalId (int externalId )
→ Future <CubeUser ? >
getUserByExternalUserId (String externalUserId )
→ Future <CubeUser ? >
getUserByFacebookId (String facebookId )
→ Future <CubeUser ? >
getUserById (int id )
→ Future <CubeUser ? >
getUserByIdentifier (String identifierName , dynamic identifierValue , {Map <String , dynamic > ? additionalParameters })
→ Future <CubeUser ? >
getUserByLogin (String login )
→ Future <CubeUser ? >
getUserByPhoneNumber (String phone )
→ Future <CubeUser ? >
getUserIdFromGroupChatJid (Jid jid )
→ int
getUserIdFromJid (Jid jid )
→ int
getUserIdFromJidString (String jid )
→ int
getUserIdFromNickWithMucDomain (String nick )
→ int
getUserNickWithMucDomain (int userId )
→ String
getUsers (Map <String , dynamic > parameters , {RequestPaginator ? paginator , RequestSorter ? sorter })
→ Future <PagedResult <CubeUser > ? >
The method returns the list according to the specified list of parameters.
The list of available parameters
is provided in the Server API documentation
by link https://developers.connectycube.com/server/users?id=retrieve-users-v2
paginator
- the instance of the helper class RequestPaginator
that is representing
the pagination parameters in the request. Note: the paginator.page
should start from 0.
sorter
- the instance of the helper class RequestSorter
that is representing
the sorting parameters in the request. The example can be var sorter = RequestSorter.desc('created_at');
getUsersByFilter (RequestFilter filter )
→ Future <PagedResult <CubeUser > ? >
Returns users by the custom filter. Possible filters provided by link https://developers.connectycube.com/server/users?id=parameters-1
For example for getting users by ids you can use the next code snippet:
getUsersByFullName (String fullName , {RequestPaginator ? paginator , RequestSorter ? sorter })
→ Future <PagedResult <CubeUser > ? >
fullName
- the part of the 'fullName' with which the name begins.
paginator
- the instance of the helper class RequestPaginator
that is representing
the pagination parameters in the request.
Pay attention: the paginator.itemsPerPage
should be 5
for this request.
Note: the paginator.page
should start from 0.
sorter
- the instance of the helper class RequestSorter
that is representing
the sorting parameters in the request. The example can be var sorter = RequestSorter.desc('created_at');
getUsersByTags (Set <String > tags , {RequestPaginator ? paginator , RequestSorter ? sorter })
→ Future <PagedResult <CubeUser > ? >
getVideoConfig ({String ? deviceId })
→ Map <String , dynamic >
getWhiteboards (String chatDialogId )
→ Future <List <CubeWhiteboard > >
Returns whiteboards related to particular chat dialog with id chatDialogId
.
iceConnectionStateForString (String ? state )
→ RTCIceConnectionState
iceGatheringStateforString (String ? state )
→ RTCIceGatheringState
init (String applicationId , String authorizationKey , String authorizationSecret , {Future <CubeSession > onSessionRestore ()? })
→ dynamic
intToStreamType (int ? type )
→ StreamType
isEmpty (String ? string )
→ bool
isEmptyList <T > (List <T > ? list )
→ bool
isGroupChatJid (Jid jid )
→ bool
listToRtpEncodings (List <Map <String , dynamic > > list )
→ List <RTCRtpEncoding >
log (String ? message , [String ? tag ])
→ dynamic
logTime (String message , [String ? tag ])
→ dynamic
mediaRecorder ()
→ MediaRecorder
metricFromString (String metricString )
→ TimeMetric
peerConnectionStateForString (String ? state )
→ RTCPeerConnectionState
rejectCall (String callSessionId , Set <int > callMembers , {String platform = 'flutter' , Map <String , String > ? userInfo })
→ Future <void >
Sends the reject
call signal via HTTP. It is useful in case when the used
doesn't have an active chat connection (for example from a Notification)
callSessionId
- the id of the P2PSession session
callMembers
- the ids of all call members including the caller and excluding
the current user
platform
- the platform name the app ran on
userInfo
- additional info about performed action
removeMessageReaction (String messageId , String reaction )
→ Future <void >
Removes the reaction on the message with messageId
what was added before
messageId
- the ID of the message you want to delete reaction of
reaction
- the reaction you want to remove
resetPassword (String email )
→ Future <void >
rtcDataChannelStateForString (String state )
→ RTCDataChannelState
searchText (String searchText , [Map <String , dynamic > ? params ])
→ Future <GlobalSearchResult >
params
- additional parameters for request. Use class-helper GlobalSearchParams to simple config search request
sendSystemMessage (int recipientId , Map <String , String > ? properties )
→ Future <CubeMessage >
Sends the System message to the recipientId
via API request
The recipient will receive this system message through the chat connection as
the common system message.
properties
- the additional parameters that the recipient will receive in the CubeMessage.properties
setEndpoints (String apiEndpoint , String chatEndpoint )
→ dynamic
signalingStateForString (String ? state )
→ RTCSignalingState
signIn (CubeUser user )
→ Future <CubeUser >
signInByEmail (String email , String password )
→ Future <CubeUser >
signInByLogin (String login , String password )
→ Future <CubeUser >
signInUsingFirebase (String projectId , String accessToken )
→ Future <CubeUser >
signInUsingFirebaseEmail (String projectId , String accessToken )
→ Future <CubeUser >
signInUsingFirebasePhone (String projectId , String accessToken )
→ Future <CubeUser >
signInUsingSocialProvider (String socialProvider , String accessToken , [String ? accessTokenSecret ])
→ Future <CubeUser >
signOut ()
→ Future <void >
signUp (CubeUser user )
→ Future <CubeUser >
streamTypeToInt (StreamType type )
→ int
subscribeToDialog (String dialogId )
→ Future <CubeDialog >
unSubscribeFromDialog (String dialogId )
→ Future <void >
updateCubeFile (CubeFile file , [bool ? isNew = false ])
→ Future <CubeFile >
Updates one or more parameters of the file. Available for updating fields: name
and contentType
.
updateCustomObject (String className , String id , Map <String , dynamic > params )
→ Future <CubeCustomObject >
Returns updated object
updateCustomObjectsByCriteria (String className , [Map <String , dynamic > ? params ])
→ Future <PagedCustomObjectResult >
Returns list of updated objects
updateDialog (String dialogId , Map <String , dynamic > params )
→ Future <CubeDialog >
params
- additional parameters for request. Use class-helper UpdateDialogParams to simple config request.
updateDialogNotificationsSettings (String dialogId , bool enable )
→ Future <bool >
updateMeeting (CubeMeeting meeting )
→ Future <CubeMeeting >
Updates the exist meeting.
More details about required parameters by link
updateMeetingById (String meetingId , Map <String , dynamic > params )
→ Future <CubeMeeting >
Updates the exist meeting.
More details about required parameters by link
updateMessage (String messageId , String dialogId , [Map <String , dynamic > ? params ])
→ Future <void >
params
- additional parameters for request. Use class-helper UpdateMessageParameters to simple config request
updateMessageReactions (String messageId , {String ? addReaction , String ? removeReaction })
→ Future <void >
Adds and/or removes reaction on the message with messageId
messageId
- the ID of the message you reacted on
addReaction
- the new reaction you want to add
removeReaction
- the reaction you added before and want to delete
updateMessages (String dialogId , Map <String , dynamic > params , [Set <String > ? messagesIds ])
→ Future <void >
params
- additional parameters for request. Use class-helper UpdateMessageParameters to simple config request
updateUser (CubeUser user )
→ Future <CubeUser >
updateWhiteboard (String whiteboardId , String newName )
→ Future <CubeWhiteboard >
Updates the exist whiteboard.
uploadAddressBook (List <CubeContact > contacts , {bool ? force , String ? udid })
→ Future <AddressBookResult ? >
uploadFile (File file , {bool ? isPublic , String ? mimeType , dynamic onProgress (int progress )? })
→ Future <CubeFile >
Uploads the File to the Connectycube storage.
Recommended file size should not exceed 100mb
uploadRawFile (List <int > bytes , String name , {bool ? isPublic , String ? mimeType , dynamic onProgress (int progress )? })
→ Future <CubeFile >
Uploads the raw file data to the Connectycube storage.
The same as uploadFile but receives raw data of file in bytes.
It is helpful for the Web platform where we don't have access to the storage.
Typedefs
Error
= void Function(WsException ex )
LayerChanged
= void Function(int userId , int layer )
LocalStreamCallback
= void Function(MediaStream stream )
PublisherLeft
= void Function(int ? userId )
PublishersReceived
= void Function(List <int ? > publishers )
RemoteStreamCallback <T >
= void Function(T session , int userId , MediaStream stream )
RemoteStreamCallbackConference <T >
= void Function(T session , int userId , MediaStream stream , {String ? trackId })
SessionClosedCallback <T >
= void Function(T session )
SessionStateCallback <T >
= void Function(T session )
SlowLink
= void Function(bool ? uplink , int ? lost )
StreamTrackCallback
= dynamic Function()
SubscribedOnPublisher
= void Function(int userId )
SubscriberAttached
= void Function(int userId )
SubStreamChanged
= void Function(int userId , StreamType streamType )
UserActionCallback <T >
= void Function(T session , int userId , [Map <String , String > ? userInfo ])
UserConnectionStateCallback <T >
= void Function(T session , int userId )