cometchat / chat-sdk-javascript Goto Github PK
View Code? Open in Web Editor NEWVoice & Video Calling and Text Chat SDK for JavaScript/Web
License: Other
Voice & Video Calling and Text Chat SDK for JavaScript/Web
License: Other
Requests to kohoutek.cometchat.com/v1.7/me AND https://kohoutek.cometchat.com/v1.7/users?per_page=100&page=1 sometimes comes back with online status of "offline' even though the user is online.
The UsersRequestBuilder fetches all the users even if setStatus is set to online.
notification received multiple times even after marking the message as read.
Hi, I use comet-chat-pro for my Angular 7.2.0 application. Everything works ver well but When I click end button console show errors and call-screen close too late. Please help me what is the problem ? I use comet-chat-pro => 1.8.13
there is an error on call start. Please check startCall() method.
Uncaught TypeError: Cannot read property 'getType' of undefined
at s.startCall (CometChat.js:1)
at Function.i.startCall (CometChat.js:1)
at cc_action.js:591
at index.js:8
at Object.startCall (CCCall.js:39)
at CCCall.componentDidMount (CCCall.js:15)
at commitLifeCycles (react-dom.development.js:15961)
at commitAllLifeCycles (react-dom.development.js:17262)
at HTMLUnknownElement.callCallback (react-dom.development.js:149)
at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
Cometchat.init does not resolve to boolean true on success, so when using async-await, we cannot be sure if the init was successful.
There is issue with respect to Media message,
Cannot send media message.
SDK version : 1.3.0
Error received : {"code":"ERR_BAD_REQUEST","message":"Failed to validate the data sent with the request.","details":{"data":["The data field is required."]}}
Uncaught TypeError: Cannot read property 'isCallstatsEnabled' of undefined Script: https://caesar.cometchat.com/libs/app.bundle.min.js?v=3387 Line: 60 Column: 227910 StackTrace: TypeError: Cannot read property 'isCallstatsEnabled' of undefined
Even with the call backs, Cometchat.init does not give out success value, nor catches the error if init failed(due to wrong appID), instead react native throws a unhandled promise rejection warning.
I reviewed https://www.cometchat.com/tutorials/angular-voice-video-chat/ this example project and I upgraded comet-chat-pro version to 1.8.13 and same problem is occurred in here. First time, end button works fine but If you try it more than one, browser gives this error => [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: null Script: null Line: null Column: null StackTrace: Error: Strophe: User connection callback caused an exception: SecurityError: Blocked a frame with origin "https://caesar.cometchat.com" from accessing a cross-origin frame.
Cometchat.init does not resolve to anything nor throws any error if mobile network is off.
With last 1.8 release (1.8.12) I have JS errors in console (with both Chrome and Firefox) and no effets when click on then red button "end video call" :
lib-jitsi-meet.min.js?v=3387:6 [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: null Script: null Line: null Column: null StackTrace: Error: Strophe: TypeError: Failed to execute 'postMessage' on 'Window': 2 arguments required, but only 1 present.
at r.window.APP.connection.addEventListener (15705171300c7dccb596aac05ff4f92488db2697d69a8ef7d8:891)
It happend just after the
Sending out message message in console.
Looking to code sending by the https://caesar.cometchat.com page it seems that the trouble is here :
this['window']['APP'].connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
()=>{
console.log("parent window", window.parent);
//console.error("diconnection");
// window.close();
console.log("Sending out message",{window})
window.postMessage(parent.postMessage(JSON.stringify({
'type': 'hangup',
'message': 'Message text from iframe.'
})),"*");
the window.postMessage also need the "*" second parameter like it is already done for parent.postMessage and about 10 lines after into the page code.
I'm trying to create some kind of visual notification alerting the user when is back online and I need to know if there are unread new messages for the user in the groups he joined.
How can I accomplish that?
When I use the listener 'onMessageDelivered' on a group, at the start it returns also the old messages that I marked with markMessageAsRead:
CometChat.addMessageListener("listenerId", new CometChat.MessageListener({
onMessageDelivered: (messageReceipt) => {
console.log("MessageDeliverd", {messageReceipt});
},onMessageRead: (messageReceipt) => {
console.log("MessageRead", {messageReceipt});
}
}));
How does it work 'markMessageAsRead' for a group message?
CometChat.markMessageAsRead(message);
Is it correct if I ask these kind of questions here?
Thank you, m.
When a user leaves the group via https://prodocs.cometchat.com/v2.0/reference#user-leavegroup, they do not receive the action via CometChat.GroupListener. Other users see the action message via onGroupMemberLeft but not the user who is leaving the group. If the user does a subsequent call to fetchPrevious() they do see the action message { action: "left" } but there is currently no active listener event to notify that the user has left the group.
I would expect the user leaving the group to also receive a onGroupMemberLeft via the CometChat.GroupListener to let them know they have been removed from the group.
I am using cometchat-pro(version : 1.8.7) in my Angular-7 app.
Problem: Pagination is not working for user request. it comes data for the first time only. when i am trying to fetch next then it brings empty array.
When switched to 'show friends only' in the dashboard settings, the app loses its ability to detect online/offline status in the user event listeners -- even after the user logs out and logs back in again. This doesn't happen when 'all users' is selected in the dashboard.
let usersRequest = new CometChat.UsersRequestBuilder()
.setLimit(limit)
.setSearchKeyword("abc")
.build();
This code return:
Unhandled promise rejection TypeError: (intermediate value).setSearchKeyword is not a function
Getting an issue when running sample ionic app with latest comechat sdk
I have the folder directory similar to the image shown below :
I have installed the node module using npm.
Now, when I try to run the following code block by importing the module in html code the file test.html, I don't see anything in the console output.
<html>
<head>
</head>
<body>
<script type="text/html">
import { CometChat } from "./node_modules/@cometchat-pro/chat";
var appID = "MY_APP_ID";
CometChat.init(appID).then(
hasInitialized => {
console.log("Initialization completed successfully", hasInitialized);
// You can now call login function.
},
error => {
console.log("Initialization failed with error:", error);
// Check the reason for error and take apppropriate action.
}
);
</script>
</body>
</html>
If possible, can you redirect me to a working javascript code for the same..since it lacks in the documentation/Github repo as well
I am getting a warning when run a react app with cometchat dependency:
Compiled with warnings.
./node_modules/@cometchat-pro/chat/CometChat.js
Module not found: Can't resolve 'react-native' in 'C:...\node_modules@cometchat-pro\chat'
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
The sdk uses Asyncstorage from react-native, instead of react-native-community/async-storage which has changed from RN0.59
If a user is logged in, and then deleted (via API/Dashboard), it's no longer possible to logout the user.
I have ending calling error now and I updated latest version (1.8.13). Please help me about this issue
When I clicked end button for finish calling, I got this error
[react/features/base/redux/StateListenerRegistry.js] <Object._listener>: TypeError: Cannot read property 'updateView' of undefined
Describe the bug*
On Android, we get "System made Joe Doe admin" text
On iOS, we get "Joe Doe's scope changed from participant to participant" text
Expected behavior
Action message should be the same.
Actual behavior
getting different action message for the same action.
When the presence for friends is subscribed using the AppSettings class as
CometChat.AppSettingsBuilder().subscribePresenceForFriends().setRegion('eu').build()
The presence for friends is not received in the onUserOnline()
and onUserOffline()
methods of the UserListener class.
For non-react-native projects
node_modules/@cometchat-pro/chat' gives error while building project,
react-native module not found
The "Device ID" seemingly takes 2 other hashes and throws the uid in the middle 40_40_40 coming to 122 characters, whereas the max is 40_18_40 = 100 characters. Not sure if it's mentioned anywhere in the docs that the max uid length is 18 but it's strange that we can create users with a longer character length when it gets rejected afterward.
Is there a method in javascript sdk to get all the groups, the logged-in-user is a member of?
Hi all, I was integrating cometchat-pro in my application and integration went well. But when i make a video call to another user on the video call screen at the bottom right there is a div with user visual as Comet chat user. Any idea why it is being shown on the screen and how to get rid of it from the UI? Thanks.
Hello. I recently upgraded to 2.0-beta6 of the JS SDK since I was encountering markAsRead issues on group chats on v1.8.12. Seems to be working fine for the last couple of days until now. My unread count for group chats isn't updating when markAsRead function is called. Seems to working fine on 1:1 messaging. Double checked the parameters that I pass to the markAsRead function and they seem to be correct. Is this a bug with the sdk?
After compiling (ionic-app-scripts 3.2.2 + Angular 4.4.3) with production command "ionic cordova run browser —prod”, when I try to login the user the error “Cannot set property ‘endpoint’ of undefined” is raised.
vendor.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot set property 'endpoint' of undefined TypeError: Cannot set property 'endpoint' of undefined at vendor.js:1 at t.invoke (polyfills.js:3) at Object.onInvoke (vendor.js:1) at t.invoke (polyfills.js:3) at r.run (polyfills.js:3) at polyfills.js:3 at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (vendor.js:1) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at c (polyfills.js:3) at polyfills.js:3 at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (vendor.js:1) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at o (polyfills.js:3) at e.invokeTask [as invoke] (polyfills.js:3) at p (polyfills.js:2) at XMLHttpRequest.v (polyfills.js:2)
return t.prototype.getEndpointData = function(t) {
var e = this;
return new Promise(function(n, s) {
o.LocalStorage.getInstance().get(i.APP_SETTINGS.APP_SETTINGS).then(function(o) {
if (r.isFalsy(o)) {
var s = void 0;
e.uriEndpoints.hasOwnProperty(t) && (s.endpoint = (s = e.uriEndpoints[t]).hasOwnProperty(["isAdminApi"]) ? e.adminApiUrl + e.adminApiVersion + "/" + s.endpoint : e.baseUrl + e.apiVersion + "/" + s.endpoint),
n(s)
} else
s = void 0,
e.uriEndpoints.hasOwnProperty(t) && (s.endpoint = (s = e.uriEndpoints[t]).hasOwnProperty(["isAdminApi"]) ? "https://" + o[i.APP_SETTINGS.KEYS.ADMIN_API_HOST] + "/" + e.adminApiVersion + "/" + s.endpoint : "https://" + o[i.APP_SETTINGS.KEYS.CLIENT_API_HOST] + "/" + e.apiVersion + "/" + s.endpoint),
n(s)
}, function(r) {
var i;
e.uriEndpoints.hasOwnProperty(t) && (i.endpoint = (i = e.uriEndpoints[t]).hasOwnProperty(["isAdminApi"]) ? e.adminApiUrl + e.adminApiVersion + "/" + i.endpoint : e.baseUrl + e.apiVersion + "/" + i.endpoint),
n(i)
})
}
)
}
The error is generated inside the first else:
e.uriEndpoints.hasOwnProperty(t) && (s.endpoint = (s = e.uriEndpoints[t]).hasOwnProperty(["isAdminApi"]) ? "https://" + o[i.APP_SETTINGS.KEYS.ADMIN_API_HOST] + "/" + e.adminApiVersion + "/" + s.endpoint : "https://" + o[i.APP_SETTINGS.KEYS.CLIENT_API_HOST] + "/" + e.apiVersion + "/" + s.endpoint), n(s)
It seem it can’t write to local storage. In fact checking the local storage there isn’t the app_settings.
In dev mode, compiling with "ionic serve" or "ionic cordova run browser" the code works without problems and the app_settings is correctly created in the local storage.
Thank you, m.
This seem to happen only when the group is dynamically created.
It seems like, the javascript-sdk doesn't know, (wasn't updated) when a group gets created making step 6:ScenarioA and step 3:ScenarioB fail. If I tweak my code to make B create the group, A was then failing. Hitting refresh, magically fixes everything. Refreshing the page might be forcing javascript-sdk to update something that makes listeners work again.
eg: when I make a call from my web app, the call works and rings, but if the attender attends it there is no response in the call listener. Also I do not get any incoming call as well.
You may also test other cases to make sure its working.
NOTE: am developing the web app in angular6+
Made a group video call from user "X". After I left the account, again tried to go, but for some reason no reaction after that was not followed.
The console displays an error.
Through other user tried to enter, everything is good, but each time when I cancel the notification of a video call from the user "X" and again I am authorized, again climbs out the notification from the user "X".
And this happens with every user. But log in to the user "X" is not possible. Is the latest version from Github.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.