Skip to content

Commit 95c8346

Browse files
committed
Starting to create a react native client for the bot ready example.
1 parent 5d0486a commit 95c8346

File tree

14 files changed

+11317
-0
lines changed

14 files changed

+11317
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ fly.toml
3232

3333
# Example files
3434
pipecat/examples/twilio-chatbot/templates/streams.xml
35+
pipecat/examples/bot-ready-signalling/client/react-native/node_modules/
36+
pipecat/examples/bot-ready-signalling/client/react-native/.expo/
37+
pipecat/examples/bot-ready-signalling/client/react-native/dist/
38+
pipecat/examples/bot-ready-signalling/client/react-native/npm-debug.*
39+
pipecat/examples/bot-ready-signalling/client/react-native/*.jks
40+
pipecat/examples/bot-ready-signalling/client/react-native/*.p8
41+
pipecat/examples/bot-ready-signalling/client/react-native/*.p12
42+
pipecat/examples/bot-ready-signalling/client/react-native/*.key
43+
pipecat/examples/bot-ready-signalling/client/react-native/*.mobileprovision
44+
pipecat/examples/bot-ready-signalling/client/react-native/*.orig.*
45+
pipecat/examples/bot-ready-signalling/client/react-native/web-build/
46+
47+
# macOS
48+
.DS_Store
49+
3550

3651
# Documentation
3752
docs/api/_build/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# React Native Implementation
2+
3+
Basic implementation using the [Pipecat React Native SDK](https://docs.pipecat.ai/client/react-native/introduction).
4+
5+
## Usage
6+
7+
### Expo requirements
8+
9+
This project cannot be used with an [Expo Go](https://docs.expo.dev/workflow/expo-go/) app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
10+
11+
When a project requires custom native code or a config plugin, we need to transition from using [Expo Go](https://docs.expo.dev/workflow/expo-go/)
12+
to a [development build](https://docs.expo.dev/development/introduction/).
13+
14+
More details about the custom native code used by this demo can be found in [rn-daily-js-expo-config-plugin](https://github.com/daily-co/rn-daily-js-expo-config-plugin).
15+
16+
### Building remotely
17+
18+
If you do not have experience with Xcode and Android Studio builds or do not have them installed locally on your computer, you will need to follow [this guide from Expo to use EAS Build](https://docs.expo.dev/development/create-development-builds/#create-and-install-eas-build).
19+
20+
### Building locally
21+
22+
You will need to have installed locally on your computer:
23+
- [Xcode](https://developer.apple.com/xcode/) to build for iOS;
24+
- [Android Studio](https://developer.android.com/studio) to build for Android;
25+
26+
#### Install the demo dependencies
27+
28+
```bash
29+
# Use the version of node specified in .nvmrc
30+
nvm i
31+
32+
# Install dependencies
33+
npm i
34+
35+
# Before a native app can be compiled, the native source code must be generated.
36+
npx expo prebuild
37+
```
38+
39+
#### Running on Android
40+
41+
After plugging in an Android device [configured for debugging](https://developer.android.com/studio/debug/dev-options), run the following command:
42+
43+
```
44+
npm run android
45+
```
46+
47+
#### Running on iOS
48+
49+
Run the following command:
50+
51+
```
52+
npm run ios
53+
```
54+
55+
#### Connect to the server
56+
Use the http://localhost:5173 in your app.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"expo": {
3+
"name": "bot-ready-rn",
4+
"slug": "bot-ready-rn",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"splash": {
10+
"image": "./assets/splash.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#ffffff"
13+
},
14+
"updates": {
15+
"fallbackToCacheTimeout": 0
16+
},
17+
"assetBundlePatterns": [
18+
"**/*"
19+
],
20+
"ios": {
21+
"supportsTablet": true,
22+
"bitcode": false,
23+
"bundleIdentifier": "co.daily.expo.BotReady",
24+
"infoPlist": {
25+
"UIBackgroundModes": [
26+
"voip"
27+
]
28+
},
29+
"appleTeamId": "EEBGKV9N3N"
30+
},
31+
"android": {
32+
"adaptiveIcon": {
33+
"foregroundImage": "./assets/adaptive-icon.png",
34+
"backgroundColor": "#FFFFFF"
35+
},
36+
"package": "co.daily.expo.BotReady",
37+
"permissions": [
38+
"android.permission.ACCESS_NETWORK_STATE",
39+
"android.permission.BLUETOOTH",
40+
"android.permission.CAMERA",
41+
"android.permission.INTERNET",
42+
"android.permission.MODIFY_AUDIO_SETTINGS",
43+
"android.permission.RECORD_AUDIO",
44+
"android.permission.SYSTEM_ALERT_WINDOW",
45+
"android.permission.WAKE_LOCK",
46+
"android.permission.FOREGROUND_SERVICE",
47+
"android.permission.FOREGROUND_SERVICE_CAMERA",
48+
"android.permission.FOREGROUND_SERVICE_MICROPHONE",
49+
"android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION",
50+
"android.permission.POST_NOTIFICATIONS"
51+
]
52+
},
53+
"web": {
54+
"favicon": "./assets/favicon.png"
55+
},
56+
"plugins": [
57+
"@config-plugins/react-native-webrtc",
58+
"@daily-co/config-plugin-rn-daily-js",
59+
[
60+
"expo-build-properties",
61+
{
62+
"android": {
63+
"minSdkVersion": 24,
64+
"compileSdkVersion": 35,
65+
"targetSdkVersion": 34,
66+
"buildToolsVersion": "35.0.0"
67+
},
68+
"ios": {
69+
"deploymentTarget": "15.1"
70+
}
71+
}
72+
]
73+
]
74+
}
75+
}
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function(api) {
2+
api.cache(true);
3+
return {
4+
presets: ['babel-preset-expo'],
5+
};
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { registerRootComponent } from "expo";
2+
3+
import App from "./src/App";
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that the environment is set up appropriately
7+
registerRootComponent(App);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Learn more https://docs.expo.io/guides/customizing-metro
2+
const { getDefaultConfig } = require('expo/metro-config');
3+
4+
module.exports = getDefaultConfig(__dirname);

0 commit comments

Comments
 (0)