Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit c567a41

Browse files
author
Mike Barnes
committed
Completed the uploadData function
1 parent 097d2fd commit c567a41

26 files changed

+601
-199
lines changed

android/app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if (flutterVersionName == null) {
2222
}
2323

2424
apply plugin: 'com.android.application'
25+
// START: FlutterFire Configuration
26+
apply plugin: 'com.google.gms.google-services'
27+
// END: FlutterFire Configuration
2528
apply plugin: 'kotlin-android'
2629
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2730

android/app/google-services.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"project_info": {
3+
"project_number": "879921616597",
4+
"project_id": "kobie-powersync-testing",
5+
"storage_bucket": "kobie-powersync-testing.appspot.com"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:879921616597:android:9593feda8e3e27e50b745c",
11+
"android_client_info": {
12+
"package_name": "co.powersync.demotodolist"
13+
}
14+
},
15+
"oauth_client": [],
16+
"api_key": [
17+
{
18+
"current_key": "AIzaSyDlGap7lRMi1-_i97Wk8PSy8s0tpuDMYBw"
19+
}
20+
],
21+
"services": {
22+
"appinvite_service": {
23+
"other_platform_oauth_client": []
24+
}
25+
}
26+
},
27+
{
28+
"client_info": {
29+
"mobilesdk_app_id": "1:879921616597:android:8cd95dd50f7b183b0b745c",
30+
"android_client_info": {
31+
"package_name": "com.powersync.kobietest"
32+
}
33+
},
34+
"oauth_client": [],
35+
"api_key": [
36+
{
37+
"current_key": "AIzaSyDlGap7lRMi1-_i97Wk8PSy8s0tpuDMYBw"
38+
}
39+
],
40+
"services": {
41+
"appinvite_service": {
42+
"other_platform_oauth_client": []
43+
}
44+
}
45+
}
46+
],
47+
"configuration_version": "1"
48+
}

android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ buildscript {
77

88
dependencies {
99
classpath 'com.android.tools.build:gradle:7.2.0'
10+
// START: FlutterFire Configuration
11+
classpath 'com.google.gms:google-services:4.3.10'
12+
// END: FlutterFire Configuration
1013
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1114
}
1215
}

database.sql

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
-- Create tables
22
create table
33
public.lists (
4-
id uuid not null default gen_random_uuid (),
4+
id text not null,
55
created_at timestamp with time zone not null default now(),
66
name text not null,
7-
owner_id uuid not null,
8-
constraint lists_pkey primary key (id),
9-
constraint lists_owner_id_fkey foreign key (owner_id) references auth.users (id) on delete cascade
7+
owner_id text not null,
8+
constraint lists_pkey primary key (id)
109
) tablespace pg_default;
1110

1211
create table
1312
public.todos (
14-
id uuid not null default gen_random_uuid (),
13+
id text not null,
1514
created_at timestamp with time zone not null default now(),
1615
completed_at timestamp with time zone null,
1716
description text not null,
1817
completed boolean not null default false,
19-
created_by uuid null,
20-
completed_by uuid null,
21-
list_id uuid not null,
18+
created_by text null,
19+
completed_by text null,
20+
list_id text not null,
2221
constraint todos_pkey primary key (id),
23-
constraint todos_created_by_fkey foreign key (created_by) references auth.users (id) on delete set null,
24-
constraint todos_completed_by_fkey foreign key (completed_by) references auth.users (id) on delete set null,
2522
constraint todos_list_id_fkey foreign key (list_id) references lists (id) on delete cascade
2623
) tablespace pg_default;
2724

@@ -35,36 +32,3 @@ alter table public.lists
3532

3633
alter table public.todos
3734
enable row level security;
38-
39-
create policy "owned lists" on public.lists for ALL using (
40-
auth.uid() = owner_id
41-
);
42-
43-
create policy "todos in owned lists" on public.todos for ALL using (
44-
auth.uid() IN (
45-
SELECT lists.owner_id FROM lists WHERE (lists.id = todos.list_id)
46-
)
47-
);
48-
49-
-- This trigger automatically creates some sample data when a user registers.
50-
-- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.
51-
create function public.handle_new_user_sample_data()
52-
returns trigger as $$
53-
declare
54-
new_list_id uuid;
55-
begin
56-
insert into public.lists (name, owner_id)
57-
values ('Shopping list', new.id)
58-
returning id into new_list_id;
59-
60-
insert into public.todos(description, list_id, created_by)
61-
values ('Bread', new_list_id, new.id);
62-
63-
insert into public.todos(description, list_id, created_by)
64-
values ('Apples', new_list_id, new.id);
65-
66-
return new;
67-
end;
68-
$$ language plpgsql security definer;
69-
70-
create trigger new_user_sample_data after insert on auth.users for each row execute procedure public.handle_new_user_sample_data();

ios/Podfile.lock

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,71 @@
11
PODS:
22
- app_links (0.0.1):
33
- Flutter
4+
- Firebase/Auth (10.18.0):
5+
- Firebase/CoreOnly
6+
- FirebaseAuth (~> 10.18.0)
7+
- Firebase/CoreOnly (10.18.0):
8+
- FirebaseCore (= 10.18.0)
9+
- firebase_auth (4.15.0):
10+
- Firebase/Auth (= 10.18.0)
11+
- firebase_core
12+
- Flutter
13+
- firebase_core (2.24.0):
14+
- Firebase/CoreOnly (= 10.18.0)
15+
- Flutter
16+
- FirebaseAppCheckInterop (10.18.0)
17+
- FirebaseAuth (10.18.0):
18+
- FirebaseAppCheckInterop (~> 10.17)
19+
- FirebaseCore (~> 10.0)
20+
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
21+
- GoogleUtilities/Environment (~> 7.8)
22+
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
23+
- RecaptchaInterop (~> 100.0)
24+
- FirebaseCore (10.18.0):
25+
- FirebaseCoreInternal (~> 10.0)
26+
- GoogleUtilities/Environment (~> 7.12)
27+
- GoogleUtilities/Logger (~> 7.12)
28+
- FirebaseCoreInternal (10.18.0):
29+
- "GoogleUtilities/NSData+zlib (~> 7.8)"
430
- Flutter (1.0.0)
31+
- GoogleUtilities/AppDelegateSwizzler (7.12.0):
32+
- GoogleUtilities/Environment
33+
- GoogleUtilities/Logger
34+
- GoogleUtilities/Network
35+
- GoogleUtilities/Environment (7.12.0):
36+
- PromisesObjC (< 3.0, >= 1.2)
37+
- GoogleUtilities/Logger (7.12.0):
38+
- GoogleUtilities/Environment
39+
- GoogleUtilities/Network (7.12.0):
40+
- GoogleUtilities/Logger
41+
- "GoogleUtilities/NSData+zlib"
42+
- GoogleUtilities/Reachability
43+
- "GoogleUtilities/NSData+zlib (7.12.0)"
44+
- GoogleUtilities/Reachability (7.12.0):
45+
- GoogleUtilities/Logger
46+
- GTMSessionFetcher/Core (3.2.0)
547
- path_provider_foundation (0.0.1):
648
- Flutter
749
- FlutterMacOS
50+
- PromisesObjC (2.3.1)
51+
- RecaptchaInterop (100.0.0)
852
- shared_preferences_foundation (0.0.1):
953
- Flutter
1054
- FlutterMacOS
1155
- sign_in_with_apple (0.0.1):
1256
- Flutter
13-
- sqlite3 (3.41.2):
14-
- sqlite3/common (= 3.41.2)
15-
- sqlite3/common (3.41.2)
16-
- sqlite3/fts5 (3.41.2):
57+
- sqlite3 (3.43.1):
58+
- sqlite3/common (= 3.43.1)
59+
- sqlite3/common (3.43.1)
60+
- sqlite3/fts5 (3.43.1):
1761
- sqlite3/common
18-
- sqlite3/perf-threadsafe (3.41.2):
62+
- sqlite3/perf-threadsafe (3.43.1):
1963
- sqlite3/common
20-
- sqlite3/rtree (3.41.2):
64+
- sqlite3/rtree (3.43.1):
2165
- sqlite3/common
2266
- sqlite3_flutter_libs (0.0.1):
2367
- Flutter
24-
- sqlite3 (~> 3.41.2)
68+
- sqlite3 (~> 3.43.1)
2569
- sqlite3/fts5
2670
- sqlite3/perf-threadsafe
2771
- sqlite3/rtree
@@ -32,6 +76,8 @@ PODS:
3276

3377
DEPENDENCIES:
3478
- app_links (from `.symlinks/plugins/app_links/ios`)
79+
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
80+
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
3581
- Flutter (from `Flutter`)
3682
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
3783
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
@@ -42,11 +88,24 @@ DEPENDENCIES:
4288

4389
SPEC REPOS:
4490
trunk:
91+
- Firebase
92+
- FirebaseAppCheckInterop
93+
- FirebaseAuth
94+
- FirebaseCore
95+
- FirebaseCoreInternal
96+
- GoogleUtilities
97+
- GTMSessionFetcher
98+
- PromisesObjC
99+
- RecaptchaInterop
45100
- sqlite3
46101

47102
EXTERNAL SOURCES:
48103
app_links:
49104
:path: ".symlinks/plugins/app_links/ios"
105+
firebase_auth:
106+
:path: ".symlinks/plugins/firebase_auth/ios"
107+
firebase_core:
108+
:path: ".symlinks/plugins/firebase_core/ios"
50109
Flutter:
51110
:path: Flutter
52111
path_provider_foundation:
@@ -64,15 +123,26 @@ EXTERNAL SOURCES:
64123

65124
SPEC CHECKSUMS:
66125
app_links: 5ef33d0d295a89d9d16bb81b0e3b0d5f70d6c875
126+
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
127+
firebase_auth: 02d1a6340f81020cc302fb8fea8518908c546cec
128+
firebase_core: f802c5c1f6caff9b8d38b591a36e7b25f8878936
129+
FirebaseAppCheckInterop: 3cd914842ba46f4304050874cd284de82f154ffd
130+
FirebaseAuth: 12314b438fa76048540c8fb86d6cfc9e08595176
131+
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
132+
FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a
67133
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
134+
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
135+
GTMSessionFetcher: 41b9ef0b4c08a6db4b7eb51a21ae5183ec99a2c8
68136
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
137+
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
138+
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
69139
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
70140
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
71-
sqlite3: fd89671d969f3e73efe503ce203e28b016b58f68
72-
sqlite3_flutter_libs: 04ba0d14a04335a2fbf9a331e8664f401fbccdd5
141+
sqlite3: e0a0623a33a20a47cb5921552aebc6e9e437dc91
142+
sqlite3_flutter_libs: 0d61e18fab1bed977dbd2d2fc76a726044ca00e7
73143
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
74144
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
75145

76146
PODFILE CHECKSUM: adb9c9fb405cdaf8ac7cbd45ad6db78acaa58c33
77147

78-
COCOAPODS: 1.12.1
148+
COCOAPODS: 1.14.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12+
5808A50FFFEBFEB63435C2A8 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = FA5376E94CB870616F8A9D3E /* GoogleService-Info.plist */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -47,6 +48,7 @@
4748
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4849
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4950
CDF8C9971FE1B0CF3262ED53 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
51+
FA5376E94CB870616F8A9D3E /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
5052
/* End PBXFileReference section */
5153

5254
/* Begin PBXFrameworksBuildPhase section */
@@ -80,6 +82,7 @@
8082
97C146EF1CF9000F007C117D /* Products */,
8183
A151B04DC3D1415EEF784588 /* Pods */,
8284
C1E97B63847FB6B811E12FEA /* Frameworks */,
85+
FA5376E94CB870616F8A9D3E /* GoogleService-Info.plist */,
8386
);
8487
sourceTree = "<group>";
8588
};
@@ -156,7 +159,7 @@
156159
97C146E61CF9000F007C117D /* Project object */ = {
157160
isa = PBXProject;
158161
attributes = {
159-
LastUpgradeCheck = 1300;
162+
LastUpgradeCheck = 1430;
160163
ORGANIZATIONNAME = "";
161164
TargetAttributes = {
162165
97C146ED1CF9000F007C117D = {
@@ -192,6 +195,7 @@
192195
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193196
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
194197
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
198+
5808A50FFFEBFEB63435C2A8 /* GoogleService-Info.plist in Resources */,
195199
);
196200
runOnlyForDeploymentPostprocessing = 0;
197201
};

ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>API_KEY</key>
6+
<string>AIzaSyDojWgY2sttGKbzMOU0tWk9JvZlQKzoHyE</string>
7+
<key>GCM_SENDER_ID</key>
8+
<string>879921616597</string>
9+
<key>PLIST_VERSION</key>
10+
<string>1</string>
11+
<key>BUNDLE_ID</key>
12+
<string>co.powersync.demotodolist</string>
13+
<key>PROJECT_ID</key>
14+
<string>kobie-powersync-testing</string>
15+
<key>STORAGE_BUCKET</key>
16+
<string>kobie-powersync-testing.appspot.com</string>
17+
<key>IS_ADS_ENABLED</key>
18+
<false></false>
19+
<key>IS_ANALYTICS_ENABLED</key>
20+
<false></false>
21+
<key>IS_APPINVITE_ENABLED</key>
22+
<true></true>
23+
<key>IS_GCM_ENABLED</key>
24+
<true></true>
25+
<key>IS_SIGNIN_ENABLED</key>
26+
<true></true>
27+
<key>GOOGLE_APP_ID</key>
28+
<string>1:879921616597:ios:0d0afa4d1d1195410b745c</string>
29+
</dict>
30+
</plist>

ios/firebase_app_id_file.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file_generated_by": "FlutterFire CLI",
3+
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
4+
"GOOGLE_APP_ID": "1:879921616597:ios:0d0afa4d1d1195410b745c",
5+
"FIREBASE_PROJECT_ID": "kobie-powersync-testing",
6+
"GCM_SENDER_ID": "879921616597"
7+
}

lib/app_config.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1+
/// Update these values
12
class AppConfig {
2-
static const String supabaseUrl = 'https://jrimaqxlgrpjipgssldo.supabase.co';
3-
static const String supabaseAnonKey =
4-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpyaW1hcXhsZ3JwamlwZ3NzbGRvIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTE1ODY5MTAsImV4cCI6MjAwNzE2MjkxMH0.K-Qb-YFz0oVpLshUEezGU-Do-sX08zKqBzVccDoZp_Y';
5-
static const String powersyncUrl =
6-
'https://64d392172a3c226cddbd5070.powersync.journeyapps.com';
3+
static const String backendUrl = 'https://4be6-71-211-245-221.ngrok-free.app';
4+
static const String powersyncUrl = 'https://65663910ce6b81ac131b8c62.powersync.journeyapps.com';
75
}

0 commit comments

Comments
 (0)