-
November 29th, 2017, 07:40 AM
#10
Hi,
I have tried this like below, It is working on my browser but not working on the device.
This file written in lsconnection.js and globally included in my application.
var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
var portToUse = document.location.protocol == "https:" ? "443" : "8080";
var lsClient = new Lightstreamer.LightstreamerClient(protocolToUse+"//mydomain.com:"+portToUse,"STOCKLIST_REMOTE");
lsClient.connectionOptions.setHttpExtraHeaders({"u sername" : "bullion"});
lsClient.enableSharing(new Lightstreamer.ConnectionSharing("CommonConnection" , "ATTACH", "CREATE"));
lsClient.connect();
And all of my three controllers written the code like bellow and subscribed in this controller only.
var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
var portToUse = document.location.protocol == "https:" ? "443" : "8080";
var lsClient = new Lightstreamer.LightstreamerClient(protocolToUse+"//mydomain.com:"+portToUse,"STOCKLIST_REMOTE");
lsClient.connectionOptions.setHttpExtraHeaders({"u sername" : "bullion"});
lsClient.enableSharing(new Lightstreamer.ConnectionSharing("CommonConnection" , "ATTACH", "CREATE"));
var liverateSubscription = new Lightstreamer.Subscription("COMMAND", liverateId, fieldList);
This working well without terminate the session on browser (ionic serve --lab). But not working after build the app and check in real device.
Similar Threads
-
By dimitarn in forum Client SDKs
Replies: 5
Last Post: December 10th, 2009, 10:52 AM
-
By cbrogliato in forum Client SDKs
Replies: 1
Last Post: October 2nd, 2009, 02:13 PM
-
By codingvn in forum Client SDKs
Replies: 5
Last Post: July 17th, 2008, 10:01 AM
-
By camerone in forum Client SDKs
Replies: 1
Last Post: August 20th, 2007, 02:37 PM
-
Replies: 1
Last Post: March 15th, 2007, 02:44 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 01:01 AM.
Bookmarks