Namespace: receiver
receiver
citrix.receiver
Members
(readonly) apiVersion
Properties
Name |
Type |
Description |
apiVersion |
String |
HDX SDK for Chrome version. |
Methods
(static) createSession(id, connectionParams, onSessionCreated)
Creates a session and returns a session instance through callback. Use the session instance to start the session, register and handle events, and to disconnect the session.
Parameters
Name |
Type |
Description |
id |
string |
Workspace app for Chrome ID. For example, the id of the store version is haiffjcadagjlijoggckpgfnoeiflnem . |
connectionParams |
connectionParams |
Configuration options to create the session. |
onSessionCreated |
onSessionCreated |
Callback containing the session object created. Signature sample: function <function_name>(session_object){…}
|
Throws
Unable to create session object.
Type
ReceiverError
Examples
Example 1: This example launches an app/desktop in a new window (similar to the session launch using Workspace app for Chrome).
//Use appropriate citrix receiver id. This sample uses store version.
//EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
var citrixReceiverId = "haiffjcadagjlijoggckpgfnoeiflnem";
try{
var connectionParams = {
"launchType" : "message"
};
function sessionCreated(sessionObject){
//Handle session interactions like events, start, disconnect here.
// Adding onConnection event handler
function connectionHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onConnection",connectionHandler);
// Adding onConnectionClosed event handler
function connectionClosedHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onConnectionClosed",connectionClosedHandler);
// Adding onError event handler
function onErrorHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onError",onErrorHandler);
//Adding onURLRedirection event handler
function onURLRedirectionHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onURLRedirection",onURLRedirectionHandler);
}
citrix.receiver.createSession(citrixReceiverId,connectionParams,sessionCreated);
}catch(ex){
console.log(ex);
}
<!--NeedCopy-->
Example 2: The following code launches an app/desktop in an appview element inside the third party Chrome app.
function createAppview() {
if (!appView) {
appView = document.createElement("appview");
appView.id = "appView";
// Appends the element to the document body.
document.body.appendChild(appView);
// Sample code for setting appview properties. Modify as needed.
appView.style.width = "800px";
appView.style.height = "800px";
appView.style.left = "0px";
appView.style.top = "100px";
appView.style.position = "absolute";
} else {
appView.style.display = "block";
}
}
//Use appropriate citrix receiver id. This sample uses store version.
//EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
var citrixReceiverId = "haiffjcadagjlijoggckpgfnoeiflnem";
try{
createAppview();
var connectionParams = {
"launchType" : "embed",
"container": appView
};
function sessionCreated(sessionObject){
//Handle session interactions like events, start, disconnect here.
// Adding onConnection event handler
function connectionHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onConnection",connectionHandler);
// Adding onConnectionClosed event handler
function connectionClosedHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onConnectionClosed",connectionClosedHandler);
// Adding onError event handler
function onErrorHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onError",onErrorHandler);
//Adding onURLRedirection event handler
function onURLRedirectionHandler(event){
console.log("Event Received : " + event.type);
console.log(event.data);
}
sessionObject.addListener("onURLRedirection",onURLRedirectionHandler);
}
citrix.receiver.createSession(citrixReceiverId,connectionParams,sessionCreated);
}catch(ex){
console.log(ex);
}
<!--NeedCopy-->
Enumerate sessions
- This API method returns the list of sessions that are currently active.
// Citrix chrome SDK API call to enumerate the sessions
citrix.receiver.enumerateSessions(workSpaceId, responseCallback);
<!--NeedCopy-->
Arguments
Name |
Type |
Description |
workSpaceId |
String |
Indicates the Citrix Workspace App ID required for SDK communication. If the workSpaceId is not specified, then the Citrix Workspace App store ID is used as the default. |
enumerateSessionsResponseCallback |
Function |
Callback function that handles the enumerate sessions response. |
enumerateSessionsResponseCallback(response)
- Callback function that handles the enumerate sessions response
Parameters
Name |
Type |
Description |
response |
Object |
Enumerate sessions response object, If there is a failure, the details of the error are set in the response object refer here for error response
|
Enumerate Sessions Response Properties
Name |
Type |
Description |
response.success |
Boolean |
Status of the method call. Holds the value true if successful |
response.data |
Array[Object] |
Holds the list of active session details (see below) for the properties associated in the data array |
Enumerate Sessions Response Data Array
Each object within the response.data
array contains the following properties:
Property |
Type |
Description |
sessionId |
String |
Represents the ID of the session |
launchType |
String |
Represent the type of launch examples: chromeSDK , downloadICA , store , fta , serviceContinuity
|
initialProgram |
String |
Holds the information of the application/desktop that was launched. |
title |
String |
Represents the title of the resource launched. |
Example
//Use appropriate Citrix Workspace App Id. This sample uses store version.
// EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
const citrixWorkspaceId = "haiffjcadagjlijoggckpgfnoeiflnem";
// writing the sample function enumerateSessions
function enumerateSessions(workspaceId, enumerateSessionsResponseCallback) {
try {
// Citrix chrome HDX API call to enumerate the sessions
citrix.receiver.enumerateSessions(workspaceId, enumerateSessionsResponseCallback);
}
catch (ex) {
// handle exception
}
}
// calling the function enumerateSessions
enumerateSessions(citrixWorkspaceId, function(response){
// business logic to handle the response
});
<!--NeedCopy-->
Sample response
{
"success": true,
"data" : [
{
"sessionId":"1717756617015",
"launchType":"store",
"initialProgram":"#Azure Managed Desktop IC $S81-137",
"title":"Azure - APAC Managed Desktop"
},
{
"sessionId":"1717756789946",
"launchType":"store",
"initialProgram":"#Azure Managed Desktop IC $S81-187",
"title":"Azure - APAC Managed Desktop"
}
]
}
<!--NeedCopy-->
Disconnect Sessions
- This API disconnects the sessions based on the session ids provided.
// Citrix chrome HDX API call to disconnect the sessions
citrix.receiver.disconnectSessions(requestFilter, (response) => {
// business logic to handle the response
});
<!--NeedCopy-->
Arguments
Name |
Type |
Description |
requestFilter |
Object |
Request filter object containing information to perform the disconnect operation. Refer to the section below (requestFilter) for details on supported properties |
disconnectSessionsResponseCallback |
Function |
Callback function that handles the disconnect sessions response. |
requestFilter
Name |
Type |
Attributes |
Description |
receiverId |
String |
Optional |
Indicates the Citrix Workspace App ID required for SDK communication. If the workSpaceId is not specified, then the Citrix Workspace App store ID is used as the default. |
filter |
Json |
Mandatory |
Contains the information required to filter active sessions and execute a disconnect operation. Refer to the section below (filter properties) for details on supported properties |
filter properties
Property |
Type |
Attributes |
Description |
sessionIds |
Array[String] |
Mandatory |
Contains the list of session IDs for disconnection. |
Sample requestFilter object
/**
* Inorder to disconnect the session based on the session ids provided, the requestFilter object should be constructed as follows:
*/
const requestFilter = {
"receiverId": "haiffjcadagjlijoggckpgfnoeiflnem",
"filter": {
"sessionIds": ["1719768640524", "1717756789946"]
}
};
<!--NeedCopy-->
disconnectSessionsResponseCallback(response)
- Callback function that handles the Disconnect Sessions response
Parameters
Property |
Type |
Description |
response |
Object |
Holds the disconnect sessions response, If there is a failure, the details of the error are set in the response object refer here for error response
|
Properties
Property |
Type |
Description |
response.success |
Boolean |
Status of the method call. Holds the value true if successful |
response.data |
array[Object] |
Provides the list of session disconnect states |
Disconnect Sessions Response Data Array
Each object within the response.data
array contains the following properties:
Property |
Type |
Description |
sessionId |
String |
Represents the ID of the session |
success |
Boolean |
Indicates whether the session was successfully disconnected (true) or if the disconnection failed (false). |
error |
String |
Provides a description of the error if the session failed to disconnect. |
Example
// step 1: get the list of active sessions using enumerateSessions API
// step 2: construct the requestFilter object with the session ids to disconnect
// step 3: call the disconnectSessions function with the requestFilter object
//Use appropriate Citrix Workspace App Id. This sample uses store version.
// EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
function disconnectSessions(citrixWorkspaceId, disconnectSessionsResponseCallBack) {
try {
// Citrix chrome HDX SDK API call to enumerate the sessions
citrix.receiver.enumerateSessions(citrixWorkspaceId, function(response) {
// business logic to handle the response
// construct the requestFilter object with the session ids to perform disconnectSessions operation
const sessionIds = response.data.map(session => session.sessionId);
const requestFilter = {
"receiverId": citrixWorkspaceId,
"filter": {
"sessionIds": sessionIds
}
};
// Citrix chrome HDX SDK API call to disconnect the sessions
citrix.receiver.disconnectSessions(requestFilter, (disconnectSessionsResponse) => {
// business logic to handle the response
disconnectSessionsResponseCallBack(disconnectSessionsResponse);
});
});
} catch (ex) {
console.log(ex);
}
}
<!--NeedCopy-->
Disconnect Sessions Sample response
{
"success": true,
"data": [
{
"sessionId": "1717756617015",
"success": true
},
{
"sessionId": "1717756789946",
"success": true
},
{
"sessionId": "1817756789946",
"success": false,
"error": "Session not found"
}
]
}
<!--NeedCopy-->
Disconnect All Sessions
- This API method disconnects all the active sessions held by Citrix Workspace App.
// Citrix chrome HDX API call to disconnect the sessions
citrix.receiver.disconnectAllSessions(workSpaceId, (response) => {
// business logic to handle the response
});
<!--NeedCopy-->
Arguments
Property |
Type |
Description |
workSpaceId |
String |
Indicates the Citrix Workspace App ID required for SDK communication. If the workSpaceId is not specified, then the Citrix Workspace App store ID is used as the default. |
disconnectAllSessionsResponseCallBack |
Function |
Callback function that handles the disconnect all sessions response. |
disconnectAllSessionsResponseCallBack(response)
- Callback function that handles the Disconnect All Sessions response
Parameters
Property |
Type |
Description |
response |
Object |
Holds the disconnect sessions response, If there is a failure, the details of the error are set in the response object refer here for error response
|
Properties
Property |
Type |
Description |
response.success |
Boolean |
Status of the method call. Holds the value true if successful |
response.data |
array[Object] |
Provides the list of session disconnect states |
Disconnect All Sessions Response Data Array
Each object within the response.data
array contains the following properties:
Property |
Type |
Description |
sessionId |
String |
Represents the ID of the session |
success |
Boolean |
Indicates whether the session was successfully disconnected (true) or if the disconnection failed (false). |
error |
String |
Provides a description of the error if the session failed to disconnect. |
Example
//Use appropriate Citrix Workspace App id. This sample uses store version.
// EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
const citrixWorkspaceId = "haiffjcadagjlijoggckpgfnoeiflnem";
// call disconnectAllSessions Api to disconnect all the sessions
citrix.receiver.disconnectAllSessions(citrixWorkspaceId, (response) => {
// business logic to handle the response
});
<!--NeedCopy-->
Disconnect All Sessions Sample response
{
"success": true,
"data": [
{
"sessionId": "1717756617015",
"success": true
},
{
"sessionId": "1717756789946",
"success": true
}
]
}
<!--NeedCopy-->
Logout user from all stores
- This API method logs out the user from the Citrix Workspace App.
// Citrix chrome HDX API call to logout the user from all the stores
citrix.receiver.logOutUserFromAllStores(workspaceId, (response) => {
// business logic to handle the response
});
<!--NeedCopy-->
Arguments
Name |
Type |
Description |
workspaceId |
String |
Indicates the Citrix Workspace App ID required for SDK communication. If the workSpaceId is not specified, then the Citrix Workspace App store ID is used as the default. |
logOutUserFromAllStoresResponseCallback |
Function |
Callback function that handles the logOut from all stores response. |
logOutUserFromAllStoresResponseCallback(response)
- Callback function that handles the logOut from all stores response
Parameters
Property |
Type |
Description |
response |
Object |
Holds the disconnect sessions response, If there is a failure, the details of the error are set in the response object refer here for error response
|
Properties
Property |
Type |
Description |
response.success |
Boolean |
Status of the method call. Holds the value true if successful |
response.message |
String |
Holds the message of the operation |
response.error |
String |
Provides a description of the error, if failed to log out the user from all store |
Example
//Use appropriate Citrix Workspace App id. This sample uses store version.
// EAR = lbfgjakkeeccemhonnolnmglmfmccaag , store version = haiffjcadagjlijoggckpgfnoeiflnem
const citrixWorkspaceId = "haiffjcadagjlijoggckpgfnoeiflnem";
// call logOutUserFromAllStores Api to logout the user from all the stores
citrix.receiver.logOutUserFromAllStores(citrixWorkspaceId, (response) => {
// business logic to handle the response
});
<!--NeedCopy-->
Logout user from all stores Sample response
{
"success": true,
"message": "User logged out from all the stores successfully."
}
<!--NeedCopy-->
The official version of this content is in English. Some of the Cloud Software Group documentation content is machine translated for your convenience only. Cloud Software Group has no control over machine-translated content, which may contain errors, inaccuracies or unsuitable language. No warranty of any kind, either expressed or implied, is made as to the accuracy, reliability, suitability, or correctness of any translations made from the English original into any other language, or that your Cloud Software Group product or service conforms to any machine translated content, and any warranty provided under the applicable end user license agreement or terms of service, or any other agreement with Cloud Software Group, that the product or service conforms with any documentation shall not apply to the extent that such documentation has been machine translated. Cloud Software Group will not be held responsible for any damage or issues that may arise from using machine-translated content.
DIESER DIENST KANN ÜBERSETZUNGEN ENTHALTEN, DIE VON GOOGLE BEREITGESTELLT WERDEN. GOOGLE LEHNT JEDE AUSDRÜCKLICHE ODER STILLSCHWEIGENDE GEWÄHRLEISTUNG IN BEZUG AUF DIE ÜBERSETZUNGEN AB, EINSCHLIESSLICH JEGLICHER GEWÄHRLEISTUNG DER GENAUIGKEIT, ZUVERLÄSSIGKEIT UND JEGLICHER STILLSCHWEIGENDEN GEWÄHRLEISTUNG DER MARKTGÄNGIGKEIT, DER EIGNUNG FÜR EINEN BESTIMMTEN ZWECK UND DER NICHTVERLETZUNG VON RECHTEN DRITTER.
CE SERVICE PEUT CONTENIR DES TRADUCTIONS FOURNIES PAR GOOGLE. GOOGLE EXCLUT TOUTE GARANTIE RELATIVE AUX TRADUCTIONS, EXPRESSE OU IMPLICITE, Y COMPRIS TOUTE GARANTIE D'EXACTITUDE, DE FIABILITÉ ET TOUTE GARANTIE IMPLICITE DE QUALITÉ MARCHANDE, D'ADÉQUATION À UN USAGE PARTICULIER ET D'ABSENCE DE CONTREFAÇON.
ESTE SERVICIO PUEDE CONTENER TRADUCCIONES CON TECNOLOGÍA DE GOOGLE. GOOGLE RENUNCIA A TODAS LAS GARANTÍAS RELACIONADAS CON LAS TRADUCCIONES, TANTO IMPLÍCITAS COMO EXPLÍCITAS, INCLUIDAS LAS GARANTÍAS DE EXACTITUD, FIABILIDAD Y OTRAS GARANTÍAS IMPLÍCITAS DE COMERCIABILIDAD, IDONEIDAD PARA UN FIN EN PARTICULAR Y AUSENCIA DE INFRACCIÓN DE DERECHOS.
本服务可能包含由 Google 提供技术支持的翻译。Google 对这些翻译内容不做任何明示或暗示的保证,包括对准确性、可靠性的任何保证以及对适销性、特定用途的适用性和非侵权性的任何暗示保证。
このサービスには、Google が提供する翻訳が含まれている可能性があります。Google は翻訳について、明示的か黙示的かを問わず、精度と信頼性に関するあらゆる保証、および商品性、特定目的への適合性、第三者の権利を侵害しないことに関するあらゆる黙示的保証を含め、一切保証しません。
ESTE SERVIÇO PODE CONTER TRADUÇÕES FORNECIDAS PELO GOOGLE. O GOOGLE SE EXIME DE TODAS AS GARANTIAS RELACIONADAS COM AS TRADUÇÕES, EXPRESSAS OU IMPLÍCITAS, INCLUINDO QUALQUER GARANTIA DE PRECISÃO, CONFIABILIDADE E QUALQUER GARANTIA IMPLÍCITA DE COMERCIALIZAÇÃO, ADEQUAÇÃO A UM PROPÓSITO ESPECÍFICO E NÃO INFRAÇÃO.