Skip to content

Commit d00295a

Browse files
committed
fix: remove secret credentials from example expo app
1 parent 5bd6cd2 commit d00295a

6 files changed

Lines changed: 155 additions & 3 deletions

File tree

examples/sync-demo-expo/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ DATABASE_NAME=sync-demo.db
1515

1616
# Table name to sync (must match the table created in SQLite Cloud)
1717
TABLE_NAME=test_table
18+
19+
# Expo/EAS Configuration
20+
# Get your project ID from: https://expo.dev/ > Your Project > Overview
21+
EAS_PROJECT_ID=
22+
23+
# App identifiers (use your own reverse domain format)
24+
IOS_BUNDLE_IDENTIFIER=com.yourcompany.sqlitesyncexample
25+
ANDROID_PACKAGE=com.yourcompany.sqlitesyncexample

examples/sync-demo-expo/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ android/
1515
# Environment variables
1616
.env
1717
.env.local
18+
19+
# Account-specific files (create your own from .example templates)
20+
google-services.json
21+
eas.json

examples/sync-demo-expo/README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,54 @@ Follow the [React Native environment setup guide](https://reactnative.dev/docs/s
4848

4949
### 3. Configure Environment Variables
5050

51-
1. **Create a `.env` file**
51+
1. **Create configuration files**
5252

5353
```bash
5454
cd examples/sync-demo-expo
5555
cp .env.example .env
56+
cp eas.json.example eas.json
5657
```
5758

58-
2. **Fill in your credentials** in the `.env` file:
59+
2. **Set up an Expo project** (for push notifications)
60+
61+
- Go to [Expo Dashboard](https://expo.dev/)
62+
- Create a new account or sign in
63+
- Create a new project and copy your **Project ID**
64+
65+
3. **Fill in your `.env` file**
5966

6067
```env
68+
# SQLite Cloud credentials
6169
SQLITE_CLOUD_CONNECTION_STRING=sqlitecloud://your-host.sqlite.cloud:8860/your-database
6270
SQLITE_CLOUD_API_KEY=your-api-key-here
6371
DATABASE_NAME=sync-demo.db
6472
TABLE_NAME=test_table
73+
74+
# Expo/EAS configuration
75+
EAS_PROJECT_ID=your-eas-project-id
76+
IOS_BUNDLE_IDENTIFIER=com.yourcompany.sqlitesyncexample
77+
ANDROID_PACKAGE=com.yourcompany.sqlitesyncexample
78+
```
79+
80+
**Note**: The `TABLE_NAME` must match the table you created in SQLite Cloud and enabled for OffSync.
81+
82+
4. **Set up push notification credentials**
83+
84+
```bash
85+
# Configure iOS APNs credentials
86+
eas credentials -p ios
87+
88+
# Configure Android FCM credentials (optional)
89+
eas credentials -p android
6590
```
6691

67-
**Note**: The `TABLE_NAME` must match the table name you created in SQLite Cloud and enabled for OffSync.
92+
5. **Configure Firebase for Android (optional)**
93+
94+
If you want push notifications on Android:
95+
96+
- Create a Firebase project at [Firebase Console](https://console.firebase.google.com/)
97+
- Add an Android app with your package name
98+
- Download `google-services.json` and place it in this directory
6899

69100
### 4. Install Dependencies
70101

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
const IS_DEV = process.env.APP_VARIANT === 'development';
2+
3+
export default {
4+
expo: {
5+
name: IS_DEV ? 'sync-demo-expo (Dev)' : 'sync-demo-expo',
6+
slug: 'sqlite-sync-demo',
7+
version: '1.0.0',
8+
orientation: 'portrait',
9+
icon: './assets/icon.png',
10+
userInterfaceStyle: 'light',
11+
newArchEnabled: true,
12+
extra: {
13+
eas: {
14+
projectId: process.env.EAS_PROJECT_ID || 'YOUR_EAS_PROJECT_ID',
15+
},
16+
},
17+
plugins: [
18+
[
19+
'expo-build-properties',
20+
{
21+
android: {
22+
minSdkVersion: 26,
23+
},
24+
},
25+
],
26+
[
27+
'expo-notifications',
28+
{
29+
enableBackgroundRemoteNotifications: true,
30+
},
31+
],
32+
],
33+
splash: {
34+
image: './assets/splash-icon.png',
35+
resizeMode: 'contain',
36+
backgroundColor: '#ffffff',
37+
},
38+
ios: {
39+
supportsTablet: true,
40+
bundleIdentifier:
41+
process.env.IOS_BUNDLE_IDENTIFIER || 'com.yourcompany.sqlitesyncexample',
42+
infoPlist: {
43+
UIBackgroundModes: ['remote-notification'],
44+
ITSAppUsesNonExemptEncryption: false,
45+
},
46+
},
47+
android: {
48+
adaptiveIcon: {
49+
foregroundImage: './assets/adaptive-icon.png',
50+
backgroundColor: '#ffffff',
51+
},
52+
edgeToEdgeEnabled: true,
53+
package:
54+
process.env.ANDROID_PACKAGE || 'com.yourcompany.sqlitesyncexample',
55+
minSdkVersion: 26,
56+
googleServicesFile: './google-services.json',
57+
},
58+
web: {
59+
favicon: './assets/favicon.png',
60+
},
61+
},
62+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"cli": {
3+
"version": ">= 13.2.0"
4+
},
5+
"build": {
6+
"development": {
7+
"developmentClient": true,
8+
"distribution": "internal"
9+
},
10+
"preview": {
11+
"distribution": "internal"
12+
},
13+
"production": {}
14+
},
15+
"submit": {
16+
"production": {}
17+
}
18+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"project_info": {
3+
"project_number": "YOUR_PROJECT_NUMBER",
4+
"project_id": "your-firebase-project-id",
5+
"storage_bucket": "your-project.firebasestorage.app"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:YOUR_PROJECT_NUMBER:android:YOUR_APP_ID",
11+
"android_client_info": {
12+
"package_name": "com.yourcompany.sqlitesyncexample"
13+
}
14+
},
15+
"oauth_client": [],
16+
"api_key": [
17+
{
18+
"current_key": "YOUR_FIREBASE_API_KEY"
19+
}
20+
],
21+
"services": {
22+
"appinvite_service": {
23+
"other_platform_oauth_client": []
24+
}
25+
}
26+
}
27+
],
28+
"configuration_version": "1"
29+
}

0 commit comments

Comments
 (0)