質問編集履歴
9
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
8
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
7
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
6
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
5
本文修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
FirebaseAuthでのGoogleログインは
|
7
7
|
デバッグエリアを見る限り成功している様ですが、
|
8
|
+
シミュレーター上でGoogleLogInボタンをタップしても、
|
8
9
|
上記画像の様なgmailアドレスとパスワードを入力する画面が立ち上がってきません。
|
9
10
|
|
10
11
|
FirebaseAuthのユーザータブから認証した(ログインした)アカウントを削除し、
|
4
本文修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,25 +16,25 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
```ここに言語を入力
|
19
|
+
(AppDelegateです)
|
19
20
|
|
20
|
-
(AppDelegateです)
|
21
|
-
|
22
21
|
import UIKit
|
23
22
|
import Firebase
|
24
23
|
import FirebaseAuth
|
25
24
|
import GoogleSignIn
|
26
25
|
import FBSDKCoreKit
|
26
|
+
import RAMAnimatedTabBarController
|
27
27
|
|
28
28
|
@UIApplicationMain
|
29
29
|
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
|
30
30
|
|
31
31
|
|
32
|
+
|
32
33
|
var window: UIWindow?
|
33
34
|
|
34
35
|
|
36
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
35
37
|
|
36
|
-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch.
|
37
|
-
|
38
38
|
print("アプリ起動時の処理だよ")
|
39
39
|
FirebaseApp.configure()
|
40
40
|
|
@@ -44,45 +44,21 @@
|
|
44
44
|
return true
|
45
45
|
}
|
46
46
|
|
47
|
+
|
47
|
-
|
48
|
+
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!)
|
49
|
+
|
50
|
+
{
|
51
|
+
|
48
|
-
func application(_
|
52
|
+
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
|
49
|
-
|
53
|
+
|
50
|
-
|
54
|
+
return GIDSignIn.sharedInstance().handle(url,
|
51
|
-
|
55
|
+
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
|
52
|
-
|
56
|
+
annotation: options[UIApplicationOpenURLOptionsKey.annotation])
|
53
|
-
|
54
|
-
}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
//
|
59
|
-
|
60
|
-
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) {
|
61
|
-
// ...
|
62
|
-
if let error = error {
|
63
|
-
print(error.localizedDescription)
|
64
|
-
return
|
65
|
-
}
|
66
|
-
print("グーグルでログインしたUser signed into googkle")
|
67
|
-
|
68
|
-
guard let authentication = user.authentication else { return }
|
69
|
-
let credential = GoogleAuthProvider.credential(withIDToken: authentication.idToken,
|
70
|
-
accessToken: authentication.accessToken)
|
71
|
-
|
72
|
-
//
|
73
|
-
Auth.auth().signIn(with: credential) { (user, error) in
|
74
|
-
print("firebaseでログインしたUser signed into googkle")
|
75
|
-
|
76
|
-
}
|
77
57
|
}
|
78
58
|
|
79
|
-
|
80
|
-
func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) {
|
81
|
-
// Perform any operations when the user disconnects from app here.
|
82
|
-
// ...
|
83
59
|
}
|
60
|
+
|
84
61
|
|
85
|
-
|
86
62
|
func applicationWillResignActive(_ application: UIApplication) {
|
87
63
|
print("アプリ閉じそう")
|
88
64
|
}
|
@@ -101,16 +77,13 @@
|
|
101
77
|
}
|
102
78
|
|
103
79
|
|
104
|
-
|
105
|
-
|
106
|
-
|
80
|
+
}
|
107
81
|
|
108
|
-
|
109
82
|
```
|
110
83
|
|
111
84
|
|
112
85
|
```ここに言語を入力
|
113
|
-
|
86
|
+
(LogInViewControllerです)
|
114
87
|
|
115
88
|
import UIKit
|
116
89
|
import Firebase
|
@@ -118,32 +91,57 @@
|
|
118
91
|
import GoogleSignIn
|
119
92
|
import FBSDKCoreKit
|
120
93
|
import FBSDKLoginKit
|
94
|
+
import RAMAnimatedTabBarController
|
121
95
|
|
122
96
|
class LogInViewController: UIViewController, GIDSignInUIDelegate {
|
123
|
-
|
124
|
-
@IBOutlet weak var GIDSignInButton: GIDSignInButton!
|
125
|
-
|
126
97
|
|
98
|
+
|
127
99
|
override func viewDidLoad() {
|
128
100
|
super.viewDidLoad()
|
129
101
|
// Do any additional setup after loading the view, typically from a nib.
|
130
102
|
GIDSignIn.sharedInstance().uiDelegate = self
|
131
|
-
|
103
|
+
GIDSignIn.sharedInstance().signIn()
|
104
|
+
}
|
105
|
+
|
132
106
|
|
107
|
+
@IBAction func GIDLigInButton(_ sender: Any) {
|
108
|
+
|
109
|
+
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
|
110
|
+
|
111
|
+
if let error = error {
|
112
|
+
print(error.localizedDescription)
|
113
|
+
return
|
114
|
+
}
|
115
|
+
print("User signed into google")
|
116
|
+
|
117
|
+
guard let authentication = user.authentication else { return }
|
118
|
+
let credential = GoogleAuthProvider.credential(withIDToken: (authentication.idToken)!,
|
119
|
+
accessToken: (authentication.accessToken)!)
|
120
|
+
|
121
|
+
|
133
122
|
|
134
|
-
//FBボタン作成
|
135
|
-
|
123
|
+
Auth.auth().signIn(with: credential) { (user, error) in
|
136
|
-
|
124
|
+
if let error = error {
|
137
|
-
|
125
|
+
print(error.localizedDescription)
|
138
|
-
|
126
|
+
return
|
139
127
|
}
|
140
128
|
|
129
|
+
|
130
|
+
print("サクセスFirebase")
|
131
|
+
|
132
|
+
|
133
|
+
let storyboard: UIStoryboard = UIStoryboard(name: "RAMAnimatedTabBar", bundle: nil)
|
134
|
+
let nextView = storyboard.instantiateInitialViewController() as! RAMAnimatedTabBarController
|
135
|
+
self.present(nextView, animated: true, completion: nil)
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
141
140
|
|
142
141
|
|
143
142
|
/* StoryboadでMailSignUpToFirstViewを引くため(戻るため)に必要 ボタン
|
144
143
|
戻る際の処理が特に必要ないのでメソッドは空です*/
|
145
|
-
|
144
|
+
func BackLogInView(segue: UIStoryboardSegue) {
|
146
145
|
}
|
147
146
|
}
|
148
|
-
|
149
147
|
```
|
3
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
2
本文修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
本文修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
swift4
|
2
2
|
xcode9.2
|
3
3
|
|
4
|
+

|
5
|
+
|
4
6
|
FirebaseAuthでのGoogleログインは
|
5
7
|
デバッグエリアを見る限り成功している様ですが、
|
6
|
-
gmailアドレスとパスワードを入力する
|
8
|
+
上記画像の様なgmailアドレスとパスワードを入力する画面が立ち上がってきません。
|
7
9
|
|
8
10
|
FirebaseAuthのユーザータブから認証した(ログインした)アカウントを削除し、
|
9
11
|
再度GoogleLogInボタンをタップしても
|
10
12
|
画面は立ち上がってきません。
|
11
13
|
|
12
|
-
どうすればgoogleログイン
|
14
|
+
どうすればgoogleログイン画面を表示できますか?
|
13
15
|
教えて頂きたいです。
|
14
16
|
|
15
17
|
|