V1 to v2 anonymous group chat

Can someone help me in coverting this V1 app to V2 i tried using cometchat instructions but failed?
Or else can someone share with me the repository of a simple chat app.

I’m sharing the github link and the medium link.


Hello @sid17tiwai,

Can you please let us know what exact issue are you facing while converting the v1 app to v2 app?

1 Like

When I used cometchat.appsettings since in the documentation provided by you it says that to init now two parameters are neccessary but while using the same I get
‘appsetting property does not exist on type Comet’

Can you please provide me any repository of v2 app to go through so that I can have a basic understanding.

Thanks for replying

Can you please let me know which version of the SDK are you using? I would suggest you to use our latest beta release (v2.0.7-beta2). Hope this helps!

I’m using the latest version.

Hello @sid17tiwai,

I had a look at the repo you cloned and it looks like there is a custom type definition file and because of that file you are getting the error saying Property 'AppSettingsBuilder' does not exist on type 'typeof CometChat'. Can you please either comment out the content of the file or delete it and check if everything is working as expected. Hope this helps.

1 Like

Sorry did the same but i guess i’m stuck on this…

Hi Now I.m getting this as my error although i have done cometchat.init() before login

Hi @sid17tiwai,

It looks like you do not have an internet connection. Please connect to an internet connection and try once again.

Tried it sir still i’m getting the same error

Hello @sid17tiwai,

It is a request to not create a new topic for the same issue. We have deleted the topic you created.
Can you please share code snippet of init and login?

Sorry for the inconvenience

Hello @sid17tiwai,

We are not able to reproduce this issue. Also the code snippet you provided are cropped. I am sharing the code snippet we used to run the app. Also in your browser console, we can see an error saying ERR_INTERNET_DISCONNECTED. Which means you are not connected to the internet. The code snippet for comet-chat.service.ts, login.component.ts and app.component.ts is as follows:

1 Like

Hi thankyou for replying actually it was showing me restrictions to attach multiple files.

And i have highlighted a part on console do you think this is a problem?

Console:-

Sorry for troubling you again. :sweat_smile:

1 Like

Hello @sid17tiwai,

It looks like you have installed the react-native SDK. You need to install our JS SDK. In your package.json file, please make sure there is no occurrence of "@cometchat-pro/react-native-chat". To install our JS SDK please insert the following in your package.json "@cometchat-pro/chat": "2.0.7-beta2", and then run npm install. And also, please remove this.init() from the login function in the comet-chat.service.ts file. And run the app again. Hope this helps!

2 Likes

Hi the above solution worked Thanks alot also in sendMessafe function i was passing 4 parameters but according to v2 only 3 are allowed i’ll read the document once again(v1->v2)

just one more concern why i’m not able to use superhero4 and superhero5 although my cometchat app has them as a user

Hello @sid17tiwai,

The tutorial you are using is made for group chats. You have to make sure that the user you login with is a member of the group or not. The user with uid superhero4 and superhero5 are banned by default from the group with guid supergroup. You can unban and then add those users in the group.

1 Like