use of im.actor.core.api.ApiAuthSession in project actor-platform by actorapp.
the class JsFacade method loadSessions.
@UsedByApp
public JsPromise loadSessions() {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
messenger.loadSessions().start(new CommandCallback<List<ApiAuthSession>>() {
@Override
public void onResult(List<ApiAuthSession> res) {
JsArray<JsAuthSession> jsSessions = JsArray.createArray().cast();
for (ApiAuthSession session : res) {
jsSessions.push(JsAuthSession.create(session));
}
resolve(jsSessions);
}
@Override
public void onError(Exception e) {
Log.e(TAG, e);
reject(e.getMessage());
}
});
}
});
}
Aggregations