From 43fb9292a23bd29bacbbdc063fca44b02ba99d84 Mon Sep 17 00:00:00 2001
From: Ryuuhj <97296543+Ryuuhj@users.noreply.github.com>
Date: Sun, 12 Mar 2023 01:35:58 +0900
Subject: [PATCH 1/5] =?UTF-8?q?[build]=20=EB=B9=8C=EB=93=9C=20=EC=85=8B?=
=?UTF-8?q?=EC=97=85=20#28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/pubspec.lock | 51 ++++++++++++++++++++++++++++++++++++++++++-
frontend/pubspec.yaml | 1 +
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock
index c27589f..3346c9b 100644
--- a/frontend/pubspec.lock
+++ b/frontend/pubspec.lock
@@ -133,6 +133,48 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
+ google_identity_services_web:
+ dependency: transitive
+ description:
+ name: google_identity_services_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.0"
+ google_sign_in:
+ dependency: "direct main"
+ description:
+ name: google_sign_in
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "6.0.2"
+ google_sign_in_android:
+ dependency: transitive
+ description:
+ name: google_sign_in_android
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "6.1.8"
+ google_sign_in_ios:
+ dependency: transitive
+ description:
+ name: google_sign_in_ios
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "5.6.1"
+ google_sign_in_platform_interface:
+ dependency: transitive
+ description:
+ name: google_sign_in_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.3.1"
+ google_sign_in_web:
+ dependency: transitive
+ description:
+ name: google_sign_in_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.11.0+2"
http:
dependency: "direct main"
description:
@@ -308,6 +350,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
+ quiver:
+ dependency: transitive
+ description:
+ name: quiver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.2.1"
rxdart:
dependency: transitive
description:
@@ -406,4 +455,4 @@ packages:
version: "6.1.0"
sdks:
dart: ">=2.18.2 <3.0.0"
- flutter: ">=3.0.0"
+ flutter: ">=3.3.0"
diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml
index b8a9d5c..e5e0c64 100644
--- a/frontend/pubspec.yaml
+++ b/frontend/pubspec.yaml
@@ -41,6 +41,7 @@ dependencies:
http: ^0.13.5
card_swiper : ^2.0.1
logger: ^1.2.2
+ google_sign_in: ^6.0.2
dev_dependencies:
flutter_test:
From e5f3ff3669cf8a116038d34b1aaad563abcc5c18 Mon Sep 17 00:00:00 2001
From: Ryuuhj <97296543+Ryuuhj@users.noreply.github.com>
Date: Tue, 14 Mar 2023 22:21:47 +0900
Subject: [PATCH 2/5] =?UTF-8?q?[build]=20=EB=B9=8C=EB=93=9C=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95=20+=20IOS/android=20=EC=84=A4=EC=A0=95=20#28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/.gitignore | 1 +
frontend/android/app/build.gradle | 21 ++++++++++++++++++--
frontend/android/app/google-service.json | 1 +
frontend/ios/Runner/GoogleService-Info.plist | 14 +++++++++++++
frontend/ios/Runner/Info.plist | 10 ++++++++++
frontend/pubspec.lock | 11 ++--------
frontend/pubspec.yaml | 2 +-
7 files changed, 48 insertions(+), 12 deletions(-)
create mode 100644 frontend/android/app/google-service.json
create mode 100644 frontend/ios/Runner/GoogleService-Info.plist
diff --git a/frontend/.gitignore b/frontend/.gitignore
index 24476c5..69a94a5 100644
--- a/frontend/.gitignore
+++ b/frontend/.gitignore
@@ -42,3 +42,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
+*.jks
\ No newline at end of file
diff --git a/frontend/android/app/build.gradle b/frontend/android/app/build.gradle
index 8861fc3..6373050 100644
--- a/frontend/android/app/build.gradle
+++ b/frontend/android/app/build.gradle
@@ -25,8 +25,14 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+/*def keystoreProperties = new Properties()
+def keystorePropertiesFile = rootProject.file('key.properties')
+if (keystorePropertiesFile.exists()) {
+ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+}*/
+
android {
- compileSdkVersion 32
+ compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
@@ -48,10 +54,20 @@ android {
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 20
- targetSdkVersion flutter.targetSdkVersion
+ targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
+ multiDexEnabled true
}
+/*
+ signingConfigs{
+ debug{
+ keyAlias 'androiddebugkey'
+ keyPassword 'android'
+ storeFile file('mykey.jks')
+ storePassword 'android'
+ }
+ }*/
buildTypes {
release {
@@ -68,4 +84,5 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'com.android.support:multidex:1.0.3'
}
diff --git a/frontend/android/app/google-service.json b/frontend/android/app/google-service.json
new file mode 100644
index 0000000..db4d1f8
--- /dev/null
+++ b/frontend/android/app/google-service.json
@@ -0,0 +1 @@
+{"installed":{"client_id":"264061539706-gbl5g4lrm1ih61biek6t8hcou9jb1mnp.apps.googleusercontent.com","project_id":"charged-ground-380504","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}
\ No newline at end of file
diff --git a/frontend/ios/Runner/GoogleService-Info.plist b/frontend/ios/Runner/GoogleService-Info.plist
new file mode 100644
index 0000000..06b2b55
--- /dev/null
+++ b/frontend/ios/Runner/GoogleService-Info.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ CLIENT_ID
+ 264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc.apps.googleusercontent.com
+ REVERSED_CLIENT_ID
+ com.googleusercontent.apps.264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc
+ PLIST_VERSION
+ 1
+ BUNDLE_ID
+ com.example.leturn
+
+
\ No newline at end of file
diff --git a/frontend/ios/Runner/Info.plist b/frontend/ios/Runner/Info.plist
index bc894e9..bbdcd01 100644
--- a/frontend/ios/Runner/Info.plist
+++ b/frontend/ios/Runner/Info.plist
@@ -12,6 +12,16 @@
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
+ CFBundleURLTypes
+
+
+ CFBundleURLSchemes
+
+
+ com.googleusercontent.apps.264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc
+
+
+
CFBundleName
leturn
CFBundlePackageType
diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock
index 3346c9b..1356a8d 100644
--- a/frontend/pubspec.lock
+++ b/frontend/pubspec.lock
@@ -133,20 +133,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- google_identity_services_web:
- dependency: transitive
- description:
- name: google_identity_services_web
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.0"
google_sign_in:
dependency: "direct main"
description:
name: google_sign_in
url: "https://pub.dartlang.org"
source: hosted
- version: "6.0.2"
+ version: "5.4.4"
google_sign_in_android:
dependency: transitive
description:
@@ -174,7 +167,7 @@ packages:
name: google_sign_in_web
url: "https://pub.dartlang.org"
source: hosted
- version: "0.11.0+2"
+ version: "0.10.2+1"
http:
dependency: "direct main"
description:
diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml
index e5e0c64..f5deb1b 100644
--- a/frontend/pubspec.yaml
+++ b/frontend/pubspec.yaml
@@ -41,7 +41,7 @@ dependencies:
http: ^0.13.5
card_swiper : ^2.0.1
logger: ^1.2.2
- google_sign_in: ^6.0.2
+ google_sign_in: ^5.4.1
dev_dependencies:
flutter_test:
From 0a9e1c90699daee60615c84c2deed454cd046a00 Mon Sep 17 00:00:00 2001
From: Ryuuhj <97296543+Ryuuhj@users.noreply.github.com>
Date: Tue, 14 Mar 2023 22:22:57 +0900
Subject: [PATCH 3/5] =?UTF-8?q?[feat]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?=
=?UTF-8?q?=EC=97=B0=EB=8F=99:=20accesstoken=20=EB=B0=9C=EA=B8=89=20#28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../lib/screens/home_screen/home_screen.dart | 22 ++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/frontend/lib/screens/home_screen/home_screen.dart b/frontend/lib/screens/home_screen/home_screen.dart
index 9b22e21..7a35068 100644
--- a/frontend/lib/screens/home_screen/home_screen.dart
+++ b/frontend/lib/screens/home_screen/home_screen.dart
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
+import 'package:google_sign_in/google_sign_in.dart';
+import 'package:leturn/api/google_signin_api.dart';
import 'package:leturn/const/colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leturn/screens/page_view.dart';
@@ -90,11 +92,7 @@ class _Buttons extends StatelessWidget{
)
],
),
- onPressed: (){
-/* Navigator.push(context,
- MaterialPageRoute(
- builder: (_) => _PageView().createState()));*/
- },
+ onPressed: signIn,
),
),
//2. 카카오 로그인
@@ -138,4 +136,18 @@ class _Buttons extends StatelessWidget{
),
);
}
+
+ Future signIn() async{
+ final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();
+ final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication;
+
+ if(googleAuth == null){
+ print("auth is null");
+ }else{
+ var acct = googleAuth!.accessToken;
+ print("success: ${acct.toString()}");
+ }
+
+ }
+
}
\ No newline at end of file
From 66f3e9b58884fe9e4a9d146fbd36ccdb3a7700e2 Mon Sep 17 00:00:00 2001
From: Ryuuhj <97296543+Ryuuhj@users.noreply.github.com>
Date: Wed, 15 Mar 2023 19:08:27 +0900
Subject: [PATCH 4/5] =?UTF-8?q?[build]=20oauth=20=ED=82=A4=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95=20#28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/android/app/google-service.json | 2 +-
frontend/ios/Runner/GoogleService-Info.plist | 4 ++--
frontend/ios/Runner/Info.plist | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/android/app/google-service.json b/frontend/android/app/google-service.json
index db4d1f8..48f7687 100644
--- a/frontend/android/app/google-service.json
+++ b/frontend/android/app/google-service.json
@@ -1 +1 @@
-{"installed":{"client_id":"264061539706-gbl5g4lrm1ih61biek6t8hcou9jb1mnp.apps.googleusercontent.com","project_id":"charged-ground-380504","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}
\ No newline at end of file
+{"installed":{"client_id":"907385257015-oq67gn993s9ss1hfne6tfedohkangtoc.apps.googleusercontent.com","project_id":"heroic-habitat-376713","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}
\ No newline at end of file
diff --git a/frontend/ios/Runner/GoogleService-Info.plist b/frontend/ios/Runner/GoogleService-Info.plist
index 06b2b55..a848db4 100644
--- a/frontend/ios/Runner/GoogleService-Info.plist
+++ b/frontend/ios/Runner/GoogleService-Info.plist
@@ -3,9 +3,9 @@
CLIENT_ID
- 264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc.apps.googleusercontent.com
+ 907385257015-aul7p80r62ileso12clfps43v9bbbr0s.apps.googleusercontent.com
REVERSED_CLIENT_ID
- com.googleusercontent.apps.264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc
+ com.googleusercontent.apps.907385257015-aul7p80r62ileso12clfps43v9bbbr0s
PLIST_VERSION
1
BUNDLE_ID
diff --git a/frontend/ios/Runner/Info.plist b/frontend/ios/Runner/Info.plist
index bbdcd01..9cfd58a 100644
--- a/frontend/ios/Runner/Info.plist
+++ b/frontend/ios/Runner/Info.plist
@@ -18,7 +18,7 @@
CFBundleURLSchemes
- com.googleusercontent.apps.264061539706-2h2ol2v6o4ckud8gcvrialhcmnli82mc
+ com.googleusercontent.apps.907385257015-aul7p80r62ileso12clfps43v9bbbr0s
From 3017919037ae2e59575e6042839eb909e1692b30 Mon Sep 17 00:00:00 2001
From: Ryuuhj <97296543+Ryuuhj@users.noreply.github.com>
Date: Wed, 15 Mar 2023 19:10:36 +0900
Subject: [PATCH 5/5] =?UTF-8?q?[feat]=20token=20=EB=B0=9C=EA=B8=89=20#28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../lib/screens/home_screen/home_screen.dart | 43 ++++++++++++++++---
1 file changed, 38 insertions(+), 5 deletions(-)
diff --git a/frontend/lib/screens/home_screen/home_screen.dart b/frontend/lib/screens/home_screen/home_screen.dart
index 7a35068..8939c8a 100644
--- a/frontend/lib/screens/home_screen/home_screen.dart
+++ b/frontend/lib/screens/home_screen/home_screen.dart
@@ -1,12 +1,19 @@
+import 'dart:convert';
+
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:leturn/api/google_signin_api.dart';
import 'package:leturn/const/colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:http/http.dart' as http;
import 'package:leturn/screens/page_view.dart';
import 'package:leturn/screens/login/login_page.dart';
+import 'package:leturn/screens/user_folder.dart';
+
+import '../../const/Server.dart';
+var token;
class HomeScreen extends StatelessWidget{
const HomeScreen({Key? key}) : super(key: key);
@@ -92,7 +99,12 @@ class _Buttons extends StatelessWidget{
)
],
),
- onPressed: signIn,
+ onPressed: () async {
+ //bool result = nextPage();
+ if(await nextPage()) {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => FolderPage()));
+ }
+ },
),
),
//2. 카카오 로그인
@@ -141,13 +153,34 @@ class _Buttons extends StatelessWidget{
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();
final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication;
- if(googleAuth == null){
- print("auth is null");
+ if(googleAuth == null) {
+ print("google login error >>> googleAuth is null");
}else{
- var acct = googleAuth!.accessToken;
- print("success: ${acct.toString()}");
+ String url = '$serverHttp/login/google';
+ //final req = jsonEncode({'access_token':googleAuth!.accessToken.toString()});
+ final req = jsonEncode({'access_token':'accessToken'});
+
+ http.Response response = await http.post(Uri.parse(url),body: req);
+
+ if(response.statusCode == 200){
+ token = jsonDecode(response.body)["token"];
+ print("token : $token");
+ //저장소에 토큰 저장
+ }else{
+ print(response.statusCode.toString());
+ }
}
}
+ Future nextPage() async{
+ await signIn();
+ if(token == null){
+ return false;
+ }else{
+ return true;
+ }
+ }
+
+
}
\ No newline at end of file