forked from calebd/SimpleAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSADAppDelegate.m
More file actions
92 lines (65 loc) · 2.54 KB
/
SADAppDelegate.m
File metadata and controls
92 lines (65 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// SADAppDelegate.m
// SimpleAuthDemo
//
// Created by Caleb Davenport on 1/16/14.
// Copyright (c) 2014 Byliner, Inc. All rights reserved.
//
#import "SADAppDelegate.h"
#import "SADProviderListViewController.h"
#import "SimpleAuth.h"
@implementation SADAppDelegate
@synthesize window = _window;
#pragma mark - Accessors
- (UIWindow *)window {
if (!_window) {
UIScreen *screen = [UIScreen mainScreen];
_window = [UIWindow new];
_window.screen = screen;
_window.frame = screen.bounds;
SADProviderListViewController *providers = [SADProviderListViewController new];
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:providers];
_window.rootViewController = navigation;
}
return _window;
}
- (void)setWindow:(UIWindow *)window {
// Do nothing
}
#pragma mark - Private
- (void)configureAuthorizaionProviders {
// consumer_key and consumer_secret are required
SimpleAuth.configuration[@"twitter"] = @{};
SimpleAuth.configuration[@"twitter-web"] = @{};
// client_id and redirect_uri are required
SimpleAuth.configuration[@"instagram"] = @{};
// app_id is required
SimpleAuth.configuration[@"facebook"] = @{};
SimpleAuth.configuration[@"facebook-web"] = @{};
// client_id and redirect_uri are required
SimpleAuth.configuration[@"meetup"] = @{};
// consumer_key and consumer_secret are required
SimpleAuth.configuration[@"tumblr"] = @{};
// client_id and redirect_uri are required
SimpleAuth.configuration[@"foursquare-web"] = @{};
// client_id and redirect_uri are required
SimpleAuth.configuration[@"dropbox-web"] = @{};
// client_id, client_secret, and redirect_uri are required
SimpleAuth.configuration[@"linkedin-web"] = @{};
// client_id and client_secret are required
SimpleAuth.configuration[@"sinaweibo-web"] = @{};
// client_id, client_secret and redirect_uri are required
// scope it is an optional paramenter and https://cloud.feedly.com/subscriptions is used if none specified
SimpleAuth.configuration[@"feedly-web"] = @{
@"client_id":@"client_id",
@"client_secret":@"client_secret",
@"redirect_uri":@"redirect_uri",
};
}
#pragma mark - UIApplicationDelegate
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self configureAuthorizaionProviders];
[self.window makeKeyAndVisible];
return YES;
}
@end