Inside example, you discovered how to make an online dating app with Behave Native

Inside example, you discovered how to make an online dating app with Behave Native

We’re going to should make a number of variations to CometChat’s UI kit so it suits all of our standards. The root list we will getting dealing with was src/cometchat-pro-react-native-ui-system.

Get rid of the real time effect key

I merely require it are an easy speak application, therefore to save anything easy, we have to eliminate the real time reaction option:

Remove composer steps option

Nevertheless for the src/components/Messages/CometChatMessageComposer/directory.js file, remove the after the password. This is basically the earliest infant of fashion.mainContainer also it will come before build.textInputContainer:

Get rid of message responses

The worst thing that individuals need to lose is the content reactions. Here is the emoji button that you select best beneath the timestamp of any content bubble:

We have to inform a couple of records to remove it. This is because new individual and transmitter enjoys independent password to have each. Very first, let us up-date the fresh new receiver variation in the src/components/Messages/CometChatReceiverTextMessageBubble/index.js. Get rid of the after the password. This really is located nearby the base, just before all the Evaluate parts try closed:

Second, change new transmitter variation at src/components/Messages/CometChatSenderTextMessageBubble/list.js. Get rid of the pursuing the code. This might be found prior to the past closure View mark:

Adding this new servers password

Part of the reason for brand new machine will be to would a corresponding CometChat user towards Firebase associate. Making one thing simple, we’ll explore Node.js and you may Fastify which will make new servers.

Keep in mind that the fresh COMETCHAT_API_Key must be the secrets there are to the API & Auth Secrets part in Other individuals API Techniques loss:

2nd, range from the channel to own starting pages. Given that you’ve seen on software password before, a blog post demand is made to that it channel whenever a user signs up. Which accepts brand new Firebase user auth ID (uid) and Firebase document ID. Title, email, and you may gender is additionally sent in the latest consult. We play with robohash on the member avatars. When we have the ability to the consumer data able, i publish the demand into the CometChat People API endpoint. Be cautious with this particular as you might possibly be lead to a keen prior to files (which means that a wrong API endpoint). Guarantee you are selecting the stable type of this new papers (currently it is at the variation dos.1). The key to remember whenever delivering the latest demand would be the fact it ought to be converted to a beneficial JSON string playing with JSON.stringify. The brand new metadata should be converted by themselves:

Running the latest software

Check in several levels you can make use of having assessment after that is they. Just remember that , you could only talk to various other associate for folks who each other appreciated each other.

That’s all! Specifically, you read how to use Firebase to implement verification in this a beneficial Work Native software. There is additionally use it as a document stores to have profiles data. Next we utilized CometChat so you can easily incorporate the new chat features.

Wern are a web site and you can mobile application developer on Philippines. The guy likes strengthening software and discussing stuff he has got discovered by the writing inside the web log. Whenever he’s not programming or discovering new things, the guy has actually working out and you will gardening.

  • Call setIsLoggedIn() means on context to help you change the fresh UI the user suositellaan luet try logged when you look at the. Note that the fresh request in order to make the CometChat representative into host really needs wait for just like the calling setIsLoggedIn() have a tendency to produce CometChat.login() so if the involved CometChat associate cannot exist yet , at this part then you’ll get a blunder.

Second, are the decide() means. This executes actions four to six throughout the realization earlier. It is conducted when the user enjoys or hates some body. The consumer analysis (person) as well as their choice (particularly otherwise hate) are enacted as the arguments. addMatchedUser() contributes the individual’s ID to the matchedUsers range that it gets omitted throughout the potential matches. The state is actually unstable whether or not, so we also have to create an alternative file to the matches range which has new logged for the pages ID, the person it enjoyed or hated, and their decision. That way, even if the representative shuts the newest software, its fits will always be unchanged.