CometChat React Native app (built using CometChat Pro React Native SDK) is a text messaging app capable of one-on-one (private) and group messaging.
Simply Clone the project from cometchat-pro-react-native-sampe-app repository and open in Text Editor of choice. To run the React Native App you need to have react native setup on your system. To setup react native you can follow the Installation guide at the follwing link React Native Setup.
We have injected two components from sample app to make Java script SDK compatible with React Native the components are as follows: 1] DOMParser 2] base-64 encode and decode
This is done in LoginScreen.js file in src folder. Here base-64 can be injected globally but DomParser needs to be injected only after CometChat.init().
Signup for CometChat and then:-
Create a new app - select version as v2 and region as Europe or USA.
-
Head over to the API Keys section and click on the Create API Key button
-
Enter a name and select the scope as Auth Only
-
Now note the API Key and App ID
-
Replace
appID
,apiKey
andappRegion
in src/LoginScreen.js with your APP ID, API KEY and APP Region respectively.
Note : APP Region values to "us" or "eu".
Signup for CometChat and then:
-
Create a new app - select version as v1
-
Head over to the API Keys section and click on the Create API Key button
-
Enter a name and select the scope as Auth Only
-
Now note the API Key and App ID
-
Replace
appID
andapiKey
in src/LoginScreen.js with your APP ID, and API KEY respectively.
Feel free to make a suggestion by creating a pull request.