1

JS API getLocations "invalid session"

Тема: JS API getLocations "invalid session"

Hello,

I use wialon local and try to get location of my units by wialon.util.Gis.getLocations, but I received "Invalid session".

When I redirect this example http://sdk.wialon.com/playground/demo/get_units to my server I received again "invalid session".

Can someone help?

2

JS API getLocations "invalid session"

Re: JS API getLocations "invalid session"

Hello

To redirect http://sdk.wialon.com/playground/demo/get_units sample to your server you have to
1. change url to wialon.js (html:7)
2. change baseUrl for session (js:59)
3. replace token to yours (js:61)

If it won't work, please save playground sample (Save button) and PM me

3

JS API getLocations "invalid session"

Re: JS API getLocations "invalid session"

Working with Wialon Local you should initSession in a special way, like this

diff:
wialon.core.Session.getInstance().initSession(<YOUR DNS>); // init session
wialon.core.Session.getInstance().initSession(<YOUR DNS>, null, 0x800); // init session

4

JS API getLocations "invalid session"

Re: JS API getLocations "invalid session"

It works now.

shmi thank you for the assistance.

It's strange that in api documentation those parameters are optional