Skip to content

Commit 7bffef3

Browse files
committed
Update obj-c pod file to use editable sources.
Add TwitterKit initialization checks.
1 parent 3b13ba8 commit 7bffef3

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

samples/objc/FirebaseUI-demo-objc/FUIAppDelegate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
@interface FUIAppDelegate : UIResponder <UIApplicationDelegate>
2020

21+
extern NSString *const kTwitterConsumerKey;
22+
extern NSString *const kTwitterConsumerSecret;
23+
2124
@property (strong, nonatomic) UIWindow *window;
2225

2326
@end

samples/objc/FirebaseUI-demo-objc/FUIAppDelegate.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@
2121
#import <GTMSessionFetcher/GTMSessionFetcherLogging.h>
2222
#import <TwitterKit/Twitter.h>
2323

24+
// TODO: Update with Twitter key and secret
25+
NSString *const kTwitterConsumerKey = @"";
26+
NSString *const kTwitterConsumerSecret = @"";
27+
2428
@implementation FUIAppDelegate
2529

2630
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
27-
[[Twitter sharedInstance] startWithConsumerKey:@""
28-
consumerSecret:@""];
31+
if (kTwitterConsumerKey.length && kTwitterConsumerSecret.length) {
32+
[[Twitter sharedInstance] startWithConsumerKey:kTwitterConsumerKey
33+
consumerSecret:kTwitterConsumerSecret];
34+
}
35+
2936
[FIRApp configure];
3037
[GTMSessionFetcher setLoggingEnabled:YES];
3138
return YES;

samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@import Firebase;
2020

2121
#import "FUIAuthViewController.h"
22+
#import "FUIAppDelegate.h"
2223
#import "FUICustomAuthDelegate.h"
2324

2425
#import <FirebaseAuthUI/FirebaseAuthUI.h>
@@ -114,7 +115,13 @@ - (void)viewDidLoad {
114115
inSection:kSectionsProviders]
115116
animated:NO
116117
scrollPosition:UITableViewScrollPositionNone];
117-
118+
// Disable twitter provider if token is not set.
119+
if (!kTwitterConsumerKey.length || !kTwitterConsumerSecret.length) {
120+
NSIndexPath *twitterRow = [NSIndexPath indexPathForRow:kIDPTwitter
121+
inSection:kSectionsProviders];
122+
[self tableView:self.tableView cellForRowAtIndexPath:twitterRow].userInteractionEnabled = NO;
123+
[self.tableView deselectRowAtIndexPath:twitterRow animated:NO];
124+
}
118125
}
119126

120127
- (void)viewWillAppear:(BOOL)animated {

samples/objc/Podfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ platform :ios, '9.0'
22

33
target 'FirebaseUI-demo-objc' do
44

5-
# used for development from sources
6-
pod 'FirebaseAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_auth.podspec"
7-
pod 'FirebaseDatabaseUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_db.podspec"
8-
pod 'FirebaseStorageUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_storage.podspec"
9-
pod 'FirebaseFacebookAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_fb.podspec"
10-
pod 'FirebaseGoogleAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_ggl.podspec"
11-
pod 'FirebaseTwitterAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_tw.podspec"
12-
pod 'FirebasePhoneAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_phone.podspec"
5+
# used for development from editable sources
6+
pod 'FirebaseAuthUI', :path => "../../FirebaseUI_dev_auth.podspec"
7+
pod 'FirebaseDatabaseUI', :path => "../../FirebaseUI_dev_db.podspec"
8+
pod 'FirebaseStorageUI', :path => "../../FirebaseUI_dev_storage.podspec"
9+
pod 'FirebaseFacebookAuthUI', :path => "../../FirebaseUI_dev_fb.podspec"
10+
pod 'FirebaseGoogleAuthUI', :path => "../../FirebaseUI_dev_ggl.podspec"
11+
pod 'FirebaseTwitterAuthUI', :path => "../../FirebaseUI_dev_tw.podspec"
12+
pod 'FirebasePhoneAuthUI', :path => "../../FirebaseUI_dev_phone.podspec"
13+
14+
# used for development from read-only sources
15+
# pod 'FirebaseAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_auth.podspec"
16+
# pod 'FirebaseDatabaseUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_db.podspec"
17+
# pod 'FirebaseStorageUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_storage.podspec"
18+
# pod 'FirebaseFacebookAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_fb.podspec"
19+
# pod 'FirebaseGoogleAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_ggl.podspec"
20+
# pod 'FirebaseTwitterAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_tw.podspec"
21+
# pod 'FirebasePhoneAuthUI', :podspec => "https://raw.githubusercontent.com/firebase/FirebaseUI-iOS/master/FirebaseUI_dev_phone.podspec"
1322

1423
# used for development from released frameworks
1524
# use_frameworks!

0 commit comments

Comments
 (0)