Comments (5)
This is expected. If you have new subscribers (or removed subscribers), you need to rebind the socket as described here: https://github.com/crisp-im/node-crisp-api#realtime-events
Using: CrispClient.rebindSocket()
from node-crisp-api.
@valeriansaliou I tried calling rebindSocket() in my updatePlugin function:
await this.crispClient.plugin.rebindSocket();
I also tried await this.crispClient.rebindSocket();
both give an error. can you share an example of how I should be calling it please? the other crispAPI calls work
from node-crisp-api.
It is this.crispClient.rebindSocket
not this.crispClient.plugin.rebindSocket
. Check your local crispClient object.
from node-crisp-api.
I tried this.crispClient.rebindSocket
as well and it didn't work, said is not a function.
the local crispClient object is the same as new Crisp()
it doesn't actually show this as a function
declare class Crisp {
auth: {};
/**
* @private
* @type {string}
*/
private _tier;
/** @private */
private _rest;
/** @private */
private _rtm;
/** @private */
private _useragent;
/** @private */
private _emitter;
/** @private */
private _socket;
/** @private */
private _socketScheduler;
/** @private */
private _socketBindHooks;
/** @private */
private _boundEvents;
setRestHost: (host: string) => void;
setRtmHost: (host: string) => void;
setTier: (tier: string) => void;
authenticate: (identifier: string, key: string) => void;
authenticateTier: (tier: string, identifier: string, key: string) => void;
head: (resource: string, query: object, body: object) => any;
get: (resource: string, query: object) => any;
post: (resource: string, query: object, body: object) => any;
patch: (resource: string, query: object, body: object) => any;
put: (resource: string, query: object, body: object) => any;
delete: (resource: string, query: object, body: object) => any;
on: (event: string, callback: Function) => void;
_prepareRestUrl: (paths: any[]) => string;
_prepareServices: () => void;
_prepareResources: (serviceInstance: object, resources: any[]) => void;
_prepareSocket: (fnBindHook: Function) => void;
_request: (resource: string, method: string, query: object, body: object, resolve: Function, reject: Function) => void;
_emitAuthenticate: () => void;
}
Also tried setting RTM mode following https://github.com/crisp-im/node-crisp-api/blob/master/examples/events_webhooks.js but even that didn't work?
from node-crisp-api.
@valeriansaliou any ideas?
from node-crisp-api.
Related Issues (20)
- How to use Bucket for uploading image via API HOT 19
- How to upload file via HTTP PUT w/? HOT 9
- Nuxt 3 support? HOT 2
- _request method does not reject with an Error object HOT 3
- Critical issue with socket-io HOT 1
- NextJS Error
- Unable to create Crisp client HOT 1
- Data validation error when sending message HOT 10
- Cannot read properties of undefined (reading '_emitter') when using HTTP WebHooks HOT 3
- No proxy support HOT 1
- Updating critical vulnerability dependency HOT 1
- 8.0.1 : Cannot find name 'WebSockets'. Did you mean 'WebSocket'? HOT 3
- Error: restricted_route_tier HOT 7
- rebindSocket function not available HOT 2
- Does Not Work With Yarn 3 HOT 6
- absenece of people_Id on conversation. HOT 1
- Helpdesk -> List Helpdesk Locale Articles. Parameter order_visits by default (with 0 value) doesn't work correctly HOT 3
- How to pass URI parameters to endpoint? HOT 1
- getMessagesInConversation is returning "route does not exist" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-crisp-api.