Giter Club home page Giter Club logo

Comments (5)

valeriansaliou avatar valeriansaliou commented on August 30, 2024

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.

jryebread avatar jryebread commented on August 30, 2024

@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
image

from node-crisp-api.

valeriansaliou avatar valeriansaliou commented on August 30, 2024

It is this.crispClient.rebindSocket not this.crispClient.plugin.rebindSocket. Check your local crispClient object.

from node-crisp-api.

jryebread avatar jryebread commented on August 30, 2024

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?
image

from node-crisp-api.

jryebread avatar jryebread commented on August 30, 2024

@valeriansaliou any ideas?

from node-crisp-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.