A simple example of how to build a chat interface using React Native. With support for image and location messages.
iOS | Android |
---|---|
iOS | Android |
---|---|
{
id, // message ID
type, // message type
from, // from which user ID
text, // context for text messages
payload, // context for other types of messages
createdAt, // timestamp
},
npm install
- To run from CLI:
react-native run-ios
orreact-native run-android
. - Or run from XCode or Android studio.
- You need to replace the Google Map API key in
/android/app/src/main/AndroidManifest.xml
for maps to work on Android. (see https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md#troubleshooting) - You will have to add this line
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
to/node_modules/react-native-maps/lib/android/build.gradle
. (see react-native-maps/react-native-maps#2695)