Skip to content

Commit 0f6dbb3

Browse files
committed
add swift demo sample for Twitter Provider
1 parent 36732b7 commit 0f6dbb3

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

samples/swift/uidemo/AppDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import UIKit
1818
import Firebase
1919
import FirebaseAuthUI
20+
import Fabric
21+
import TwitterKit
2022

2123
@UIApplicationMain
2224
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -27,6 +29,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2729
// Successfully running this sample requires an app in Firebase and an
2830
// accompanying valid GoogleService-Info.plist file.
2931
FIRApp.configure()
32+
Fabric.with([Twitter.self])
3033
return true
3134
}
3235

samples/swift/uidemo/AuthViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Firebase
1919
import FirebaseAuthUI
2020
import FirebaseGoogleAuthUI
2121
import FirebaseFacebookAuthUI
22+
import FirebaseTwitterAuthUI
2223

2324
let kFirebaseTermsOfService = NSURL(string: "https://firebase.google.com/terms/")!
2425

@@ -62,6 +63,7 @@ class AuthViewController: UIViewController {
6263
let providers: [FIRAuthProviderUI] = [
6364
FIRGoogleAuthUI(clientID: kGoogleAppClientID),
6465
FIRFacebookAuthUI(appID: kFacebookAppID),
66+
FIRTwitterAuthUI(),
6567
]
6668
self.authUI?.providers = providers
6769

samples/swift/uidemo/Info.plist

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>LSApplicationQueriesSchemes</key>
6-
<array>
7-
<string>fbapi</string>
8-
<string>fb-messenger-api</string>
9-
<string>fbauth2</string>
10-
<string>fbshareextension</string>
11-
</array>
125
<key>CFBundleDevelopmentRegion</key>
136
<string>en</string>
147
<key>CFBundleExecutable</key>
@@ -30,22 +23,62 @@
3023
<dict>
3124
<key>CFBundleTypeRole</key>
3225
<string>Editor</string>
26+
<key>CFBundleURLName</key>
27+
<string>REVERSED_CLIENT_ID</string>
3328
<key>CFBundleURLSchemes</key>
3429
<array>
35-
<string>REVERSED_CLIENT_ID</string>
30+
<string>REPLACE_ME_WITH_REVERSED_CLIENT_ID</string>
3631
</array>
3732
</dict>
3833
<dict>
3934
<key>CFBundleTypeRole</key>
4035
<string>Editor</string>
36+
<key>CFBundleURLName</key>
37+
<string>FACEBOOK_APP_ID</string>
4138
<key>CFBundleURLSchemes</key>
4239
<array>
43-
<string>FACEBOOK_APP_ID</string>
40+
<string>REPLACE_ME_WITH_FACEBOOK_APP_ID</string>
41+
</array>
42+
</dict>
43+
<dict>
44+
<key>CFBundleTypeRole</key>
45+
<string>Editor</string>
46+
<key>CFBundleURLName</key>
47+
<string>TWITTER_CONSUMER_KEY</string>
48+
<key>CFBundleURLSchemes</key>
49+
<array>
50+
<string>twitterkit-&lt;consumer_key&gt;</string>
4451
</array>
4552
</dict>
4653
</array>
4754
<key>CFBundleVersion</key>
4855
<string>1</string>
56+
<key>Fabric</key>
57+
<dict>
58+
<key>APIKey</key>
59+
<string>FABRIC_API_KEY</string>
60+
<key>Kits</key>
61+
<array>
62+
<dict>
63+
<key>KitInfo</key>
64+
<dict>
65+
<key>consumerKey</key>
66+
<string>Consumer Key</string>
67+
<key>consumerSecret</key>
68+
<string>Consumer Secret</string>
69+
</dict>
70+
<key>KitName</key>
71+
<string>Twitter</string>
72+
</dict>
73+
</array>
74+
</dict>
75+
<key>LSApplicationQueriesSchemes</key>
76+
<array>
77+
<string>fbapi</string>
78+
<string>fb-messenger-api</string>
79+
<string>fbauth2</string>
80+
<string>fbshareextension</string>
81+
</array>
4982
<key>LSRequiresIPhoneOS</key>
5083
<true/>
5184
<key>UILaunchStoryboardName</key>

samples/swift/uidemo/Sample.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ enum Sample: Int, RawRepresentable {
2323

2424
// When adding new samples, add a new value here and fill
2525
// out the switch statements below as necessary.
26-
case Chat = 0
27-
case Auth = 1
28-
26+
case Auth = 0
27+
case Chat = 1
28+
2929
static var total: Int {
3030
var count = 0
3131
while let _ = Sample(rawValue: count) {

0 commit comments

Comments
 (0)