Skip to content

Commit 66e725b

Browse files
authored
feat: add live location sharing sample app (#105)
* feat: add live location sharing sample app * add disconnect
1 parent 9227f67 commit 66e725b

File tree

76 files changed

+16109
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+16109
-0
lines changed
Loading
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
**/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
**/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage
67+
68+
# Yarn
69+
.yarn/*
70+
!.yarn/patches
71+
!.yarn/plugins
72+
!.yarn/releases
73+
!.yarn/sdks
74+
!.yarn/versions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.2.1)
9+
base64
10+
bigdecimal
11+
concurrent-ruby (~> 1.0, >= 1.3.1)
12+
connection_pool (>= 2.2.5)
13+
drb
14+
i18n (>= 1.6, < 2)
15+
logger (>= 1.4.2)
16+
minitest (>= 5.1)
17+
securerandom (>= 0.3)
18+
tzinfo (~> 2.0, >= 2.0.5)
19+
addressable (2.8.7)
20+
public_suffix (>= 2.0.2, < 7.0)
21+
algoliasearch (1.27.5)
22+
httpclient (~> 2.8, >= 2.8.3)
23+
json (>= 1.5.1)
24+
atomos (0.1.3)
25+
base64 (0.2.0)
26+
bigdecimal (3.1.8)
27+
claide (1.1.0)
28+
cocoapods (1.15.2)
29+
addressable (~> 2.8)
30+
claide (>= 1.0.2, < 2.0)
31+
cocoapods-core (= 1.15.2)
32+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
33+
cocoapods-downloader (>= 2.1, < 3.0)
34+
cocoapods-plugins (>= 1.0.0, < 2.0)
35+
cocoapods-search (>= 1.0.0, < 2.0)
36+
cocoapods-trunk (>= 1.6.0, < 2.0)
37+
cocoapods-try (>= 1.1.0, < 2.0)
38+
colored2 (~> 3.1)
39+
escape (~> 0.0.4)
40+
fourflusher (>= 2.3.0, < 3.0)
41+
gh_inspector (~> 1.0)
42+
molinillo (~> 0.8.0)
43+
nap (~> 1.0)
44+
ruby-macho (>= 2.3.0, < 3.0)
45+
xcodeproj (>= 1.23.0, < 2.0)
46+
cocoapods-core (1.15.2)
47+
activesupport (>= 5.0, < 8)
48+
addressable (~> 2.8)
49+
algoliasearch (~> 1.0)
50+
concurrent-ruby (~> 1.1)
51+
fuzzy_match (~> 2.0.4)
52+
nap (~> 1.0)
53+
netrc (~> 0.11)
54+
public_suffix (~> 4.0)
55+
typhoeus (~> 1.0)
56+
cocoapods-deintegrate (1.0.5)
57+
cocoapods-downloader (2.1)
58+
cocoapods-plugins (1.0.0)
59+
nap
60+
cocoapods-search (1.0.1)
61+
cocoapods-trunk (1.6.0)
62+
nap (>= 0.8, < 2.0)
63+
netrc (~> 0.11)
64+
cocoapods-try (1.2.0)
65+
colored2 (3.1.2)
66+
concurrent-ruby (1.3.4)
67+
connection_pool (2.4.1)
68+
drb (2.2.1)
69+
escape (0.0.4)
70+
ethon (0.16.0)
71+
ffi (>= 1.15.0)
72+
ffi (1.17.0)
73+
fourflusher (2.3.1)
74+
fuzzy_match (2.0.4)
75+
gh_inspector (1.1.3)
76+
httpclient (2.8.3)
77+
i18n (1.14.5)
78+
concurrent-ruby (~> 1.0)
79+
json (2.7.2)
80+
logger (1.6.1)
81+
minitest (5.25.1)
82+
molinillo (0.8.0)
83+
nanaimo (0.3.0)
84+
nap (1.1.0)
85+
netrc (0.11.0)
86+
nkf (0.2.0)
87+
public_suffix (4.0.7)
88+
rexml (3.3.6)
89+
strscan
90+
ruby-macho (2.5.1)
91+
securerandom (0.3.1)
92+
strscan (3.1.0)
93+
typhoeus (1.4.1)
94+
ethon (>= 0.9.0)
95+
tzinfo (2.0.6)
96+
concurrent-ruby (~> 1.0)
97+
xcodeproj (1.25.0)
98+
CFPropertyList (>= 2.3.3, < 4.0)
99+
atomos (~> 0.1.3)
100+
claide (>= 1.0.2, < 2.0)
101+
colored2 (~> 3.1)
102+
nanaimo (~> 0.3.0)
103+
rexml (>= 3.3.2, < 4.0)
104+
105+
PLATFORMS
106+
ruby
107+
108+
DEPENDENCIES
109+
activesupport (>= 6.1.7.5, != 7.1.0)
110+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
111+
112+
RUBY VERSION
113+
ruby 3.2.3p157
114+
115+
BUNDLED WITH
116+
2.4.19
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
# Live Location Sharing Chat Sample Using Stream Chat React Native SDK
3+
4+
| Chat screen preview | Map detail screen preview |
5+
|---|---|
6+
| ![Preview of the Chat screen](../../images/LiveLocationStreamChatSample/chat-screen-ios.png) | ![Preview of the Map detail screen](../../images/LiveLocationStreamChatSample/detail-map-screen-ios.png)
7+
8+
This sample app is implemented using Stream Chat React Native SDK. It is a fully fledged messaging app with the ability of sharing live location.
9+
10+
## Step 1: Setup
11+
12+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
13+
14+
**Install package dependencies:**
15+
16+
```bash
17+
# Install dependencies
18+
yarn
19+
bundle install
20+
21+
# Install pod dependencies
22+
bundle exec pod install --project-directory=ios
23+
```
24+
25+
### Specify your Google Maps API key
26+
27+
The actual map implementation depends on the platform. On Android, one has to use [Google Maps](https://developers.google.com/maps/documentation/), which in turn requires you to obtain an [API key for the Android SDK](https://developers.google.com/maps/documentation/android-sdk/signup). On iOS, the native Apple Maps implementation is used and API keys are not necessary.
28+
29+
Add your API key to your manifest file (`android/app/src/main/AndroidManifest.xml`):
30+
31+
```xml
32+
<application>
33+
<!-- You will only need to add this meta-data tag, but make sure it's a child of application -->
34+
<meta-data
35+
android:name="com.google.android.geo.API_KEY"
36+
android:value="Your Google maps API Key Here"/>
37+
</application>
38+
```
39+
40+
## Step 1: Start the Metro Server
41+
42+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
43+
44+
To start Metro, run the following command from the _root_ of your React Native project:
45+
46+
```bash
47+
yarn start
48+
```
49+
50+
## Step 2: Start the Application
51+
52+
Run the following command to start your _Android_ or _iOS_ app:
53+
54+
### For Android
55+
56+
```bash
57+
yarn android
58+
```
59+
60+
### For iOS
61+
62+
```bash
63+
yarn ios
64+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../src/App';
8+
9+
// Note: import explicitly to use the types shipped with jest.
10+
import {it} from '@jest/globals';
11+
12+
// Note: test renderer must be required after react-native.
13+
import renderer from 'react-test-renderer';
14+
15+
it('renders correctly', () => {
16+
renderer.create(<App />);
17+
});

0 commit comments

Comments
 (0)