N
Novuβ€’5mo ago
Luiz Carvalho

isOnline always false in Angular project β€” how to fix?

Hey everyone! πŸ‘‹ I'm using the Novu library in an Angular project, and everything is rendering correctly. However, I'm having an issue where the isOnline property of the user always remains false, even though the setup seems correct and the widget is connected. Is there anything specific I need to do in Angular to ensure that the user presence tracking works correctly? For example: Do I need to manually trigger any connection methods? Is there any known issue when using Novu with Angular that affects isOnline? Thanks in advance for your help! πŸ™
15 Replies
Novu_Bot
Novu_Botβ€’5mo ago
@Luiz Carvalho, you just advanced to level 1!
Pawan Jain
Pawan Jainβ€’5mo ago
@Luiz Carvalho Could you please share more information on isOnline field, where are you using this field?
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
No description
No description
No description
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
sorry for the amount of images, but I'm using the step conditions of the inbox step and I'm making sure that the subscriberId is active if i change it to false the message arrives correctly
Pawan Jain
Pawan Jainβ€’5mo ago
@Luiz Carvalho I will take a look on this
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
Thanks man!
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
One detail, I noticed that the notification center of the trigger for testing works with the isOnline property
No description
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
any feedback? @Pawan Jain
Pawan Jain
Pawan Jainβ€’5mo ago
@Luiz Carvalho small information on isOnline field. It is true when inbox is active in any of the broswer tab means inbox has created a socket connection with Novu ws server
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
@Pawan Jain right, even with everything operational and with the central rendered and socket connected the status is false, I am validating through the API "Retrieve a subscriber" I'm using it like this:
this._novu = new Novu({
applicationIdentifier: options.applicationIdentifier || '',
subscriber: this.subscriber,
apiUrl: this.apiUrl,
socketUrl: this.socketUrl,
});
this._novu = new Novu({
applicationIdentifier: options.applicationIdentifier || '',
subscriber: this.subscriber,
apiUrl: this.apiUrl,
socketUrl: this.socketUrl,
});
const novu = new NovuUI({
options: {
applicationIdentifier: this._novuService.applicationIdentifier,
subscriberId: this._novuService.subscriberId,
apiUrl: this._novuService.apiUrl,
socketUrl: this._novuService.socketUrl,
},
tabs: this.tabs,
localization: ptBR,
appearance: THEME_DARK,
});
const novu = new NovuUI({
options: {
applicationIdentifier: this._novuService.applicationIdentifier,
subscriberId: this._novuService.subscriberId,
apiUrl: this._novuService.apiUrl,
socketUrl: this._novuService.socketUrl,
},
tabs: this.tabs,
localization: ptBR,
appearance: THEME_DARK,
});
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
the socket connects and keeps pinging
No description
Pawan Jain
Pawan Jainβ€’5mo ago
@Luiz Carvalho Are you using EU or US region of our cloud?
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
US I think API: wss://ws.novu.co/socket.io @Pawan Jain Even if it doesn't work automatically, it would be great if the @novu/js sdk could do this manually, perhaps by hitting the API https://api.novu.co/v1/subscribers/string/online-status
Pawan Jain
Pawan Jainβ€’5mo ago
@Luiz Carvalho can you remove socket url and backend url? in case of US region, these are auto configured
Luiz Carvalho
Luiz CarvalhoOPβ€’5mo ago
wow this solved the problem it seems

Did you find this page helpful?