Skip to content

Commit 507a1e3

Browse files
committed
WIP
1 parent ae424b4 commit 507a1e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+813
-3030
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ buck-out/
4040
android/app/libs
4141
android/keystores/debug.keystore
4242
Releases/
43+
ios/Pods
44+
config/development.ios.js
45+
config/development.js

app/views/Authentication/Demos/Providers.js

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,37 @@ import React from 'react'
33
import {
44
View,
55
Text,
6+
NativeModules
67
} from 'react-native'
78

9+
import env from '../../../../config/environment';
10+
import { Container, Header, Title, Content, Button } from 'native-base';
811
import appStyles from '../../../styles/app';
12+
import OAuthManager from 'react-native-oauth';
913

14+
const supportedProviders = OAuthManager.providers();
1015
export class Providers extends React.Component {
1116

1217
componentWillMount() {
1318
const {firestack} = this.props;
19+
const manager = new OAuthManager('firestackexample')
20+
manager.configure(env.auth);
21+
22+
this.manager = manager;
23+
}
24+
25+
loginWith(provider) {
26+
return (evt) => {
27+
console.log('loginWith', provider);
28+
this.manager
29+
.authorize(provider, {})
30+
.then(resp => {
31+
console.log('response ->', resp);
32+
})
33+
.catch(err => {
34+
console.log('error ->', err);
35+
})
36+
}
1437
}
1538

1639
componentWillUnmount() {
@@ -19,13 +42,19 @@ export class Providers extends React.Component {
1942

2043
render() {
2144
return (
22-
<View>
23-
<View style={appStyles.container}>
24-
<Text>
25-
This is a test for dealing with Auth.
26-
</Text>
27-
</View>
28-
</View>
45+
<Container>
46+
<Content>
47+
{supportedProviders.map(provider => {
48+
return (
49+
<Button
50+
key={provider}
51+
onPress={this.loginWith(provider)}>
52+
Login with {provider}
53+
</Button>
54+
)
55+
})}
56+
</Content>
57+
</Container>
2958
)
3059
}
3160

config/development.example.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module.exports = {
22
firestack: {
3-
debug: '*',
4-
apiKey: "Your api key",
5-
authDomain: "Your auth domain",
6-
databaseURL: "Your database url",
7-
storageBucket: "Your storage bucket",
8-
googleAppId: 'Your google app ID'
9-
}
3+
debug: '*',
4+
apiKey: "Your api key",
5+
authDomain: "Your auth domain",
6+
databaseURL: "Your database url",
7+
storageBucket: "Your storage bucket",
8+
googleAppId: 'Your google app ID'
9+
},
10+
auth: {}
1011
}

config/development.ios.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
module.exports = {
22
firestack: {
33
debug: '*',
4-
cloudMessaging: {
5-
enabled: true
6-
}
74
}
85
}

config/development.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
firestack: {
33
debug: '*',
4-
}
4+
},
5+
auth: {}
56
}

ios/FirestackApp.xcodeproj/project.pbxproj

Lines changed: 62 additions & 13 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "242347836210DA0FD81821B3FF38531CD63A6B4C",
3+
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4+
5+
},
6+
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
7+
"185F96754A06BC8FF2134DF1E4AA46B641DBED2D" : 0,
8+
"242347836210DA0FD81821B3FF38531CD63A6B4C" : 0
9+
},
10+
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "64B9E901-CA6F-4A7C-9DB7-CD4AA859D2A4",
11+
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
12+
"185F96754A06BC8FF2134DF1E4AA46B641DBED2D" : "OAuthManager\/",
13+
"242347836210DA0FD81821B3FF38531CD63A6B4C" : "FirestackApp\/"
14+
},
15+
"DVTSourceControlWorkspaceBlueprintNameKey" : "FirestackApp",
16+
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
17+
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "ios\/FirestackApp.xcworkspace",
18+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
19+
{
20+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:fullstackreact\/react-native-oauth.git",
21+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
22+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "185F96754A06BC8FF2134DF1E4AA46B641DBED2D"
23+
},
24+
{
25+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:fullstackio\/FirestackApp.git",
26+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
27+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "242347836210DA0FD81821B3FF38531CD63A6B4C"
28+
}
29+
]
30+
}

ios/FirestackApp/AppDelegate.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#import "RCTBundleURLProvider.h"
1313
#import "RCTRootView.h"
14+
#import "OAuthManager.h"
1415

1516
@implementation AppDelegate
1617

@@ -29,9 +30,22 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2930
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
3031
UIViewController *rootViewController = [UIViewController new];
3132
rootViewController.view = rootView;
33+
34+
[OAuthManager setupOAuthHandler:application
35+
andDelegate:self
36+
view:rootView];
37+
3238
self.window.rootViewController = rootViewController;
3339
[self.window makeKeyAndVisible];
3440
return YES;
3541
}
3642

43+
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
44+
NSLog(@"application openURL called: %@", url);
45+
return [OAuthManager handleOpenUrl:application
46+
openURL:url
47+
sourceApplication:sourceApplication
48+
annotation:annotation];
49+
}
50+
3751
@end

ios/FirestackApp/Info.plist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,27 @@
1818
<string>1.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
21+
<key>CFBundleURLTypes</key>
22+
<array>
23+
<dict>
24+
<key>CFBundleTypeRole</key>
25+
<string>Editor</string>
26+
<key>CFBundleURLName</key>
27+
<string>io.fullstack.FirestackExample</string>
28+
<key>CFBundleURLSchemes</key>
29+
<array>
30+
<string>firestackexample</string>
31+
</array>
32+
</dict>
33+
</array>
2134
<key>CFBundleVersion</key>
2235
<string>76</string>
2336
<key>LSRequiresIPhoneOS</key>
2437
<true/>
2538
<key>NSAppTransportSecurity</key>
2639
<dict>
40+
<key>NSAllowsArbitraryLoads</key>
41+
<true/>
2742
<key>NSExceptionDomains</key>
2843
<dict>
2944
<key>localhost</key>

ios/Podfile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source 'https://github.com/CocoaPods/Specs.git'
2-
#platform :ios, '8.0'
2+
platform :ios, '8.0'
33

44
def firestack_pods
55
[
@@ -16,15 +16,6 @@ def firestack_pods
1616
end
1717

1818
target 'FirestackApp' do
19-
use_frameworks!
2019
firestack_pods
21-
pod 'OAuthSwift', '~> 0.5.2'
22-
end
23-
24-
post_install do |installer|
25-
installer.pods_project.build_configurations.each do |config|
26-
# Configure Pod targets for Xcode 8 compatibility
27-
config.build_settings['SWIFT_VERSION'] = '2.1'
28-
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
29-
end
20+
pod 'DCTAuth', :git => 'https://github.com/danielctull/DCTAuth.git'
3021
end

ios/Podfile.lock

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
PODS:
2-
- Firebase (3.7.0):
3-
- Firebase/Core (= 3.7.0)
4-
- Firebase/Auth (3.7.0):
2+
- DCTAuth (3.0)
3+
- Firebase (3.7.1):
4+
- Firebase/Core (= 3.7.1)
5+
- Firebase/Auth (3.7.1):
56
- Firebase/Core
67
- FirebaseAuth (= 3.0.5)
7-
- Firebase/Core (3.7.0):
8-
- FirebaseAnalytics (= 3.4.3)
8+
- Firebase/Core (3.7.1):
9+
- FirebaseAnalytics (= 3.4.4)
910
- FirebaseCore (= 3.4.3)
10-
- Firebase/Database (3.7.0):
11+
- Firebase/Database (3.7.1):
1112
- Firebase/Core
1213
- FirebaseDatabase (= 3.0.3)
13-
- Firebase/Messaging (3.7.0):
14+
- Firebase/Messaging (3.7.1):
1415
- Firebase/Core
1516
- FirebaseMessaging (= 1.2.0)
16-
- Firebase/RemoteConfig (3.7.0):
17+
- Firebase/RemoteConfig (3.7.1):
1718
- Firebase/Core
1819
- FirebaseRemoteConfig (= 1.3.0)
19-
- Firebase/Storage (3.7.0):
20+
- Firebase/Storage (3.7.1):
2021
- Firebase/Core
2122
- FirebaseStorage (= 1.0.3)
22-
- FirebaseAnalytics (3.4.3):
23+
- FirebaseAnalytics (3.4.4):
2324
- FirebaseCore (~> 3.4)
2425
- FirebaseInstanceID (~> 1.0)
2526
- GoogleInterchangeUtilities (~> 1.2)
2627
- GoogleSymbolUtilities (~> 1.1)
27-
- GoogleUtilities (~> 1.3)
2828
- FirebaseAuth (3.0.5):
2929
- FirebaseAnalytics (~> 3.3)
3030
- GoogleNetworkingUtilities (~> 1.2)
@@ -61,21 +61,30 @@ PODS:
6161
- GoogleSymbolUtilities (1.1.2)
6262
- GoogleUtilities (1.3.2):
6363
- GoogleSymbolUtilities (~> 1.1)
64-
- OAuthSwift (0.5.2)
6564

6665
DEPENDENCIES:
66+
- DCTAuth (from `https://github.com/danielctull/DCTAuth.git`)
6767
- Firebase
6868
- Firebase/Auth
6969
- Firebase/Core
7070
- Firebase/Database
7171
- Firebase/Messaging
7272
- Firebase/RemoteConfig
7373
- Firebase/Storage
74-
- OAuthSwift (~> 0.5.2)
74+
75+
EXTERNAL SOURCES:
76+
DCTAuth:
77+
:git: https://github.com/danielctull/DCTAuth.git
78+
79+
CHECKOUT OPTIONS:
80+
DCTAuth:
81+
:commit: 0a8091a3fc165fb99a6f70cf15b3aed25252dad9
82+
:git: https://github.com/danielctull/DCTAuth.git
7583

7684
SPEC CHECKSUMS:
77-
Firebase: 3875e140d77c7572c6d4852faf94144ffcdb0704
78-
FirebaseAnalytics: 02d0aed8c6246a9c8683ac3e9825c67ceb657bde
85+
DCTAuth: 8add154decd00335d62917828896bba790ce47fd
86+
Firebase: be473484f0d515e72ffd04acf22f981773c23e58
87+
FirebaseAnalytics: 0533a00b681e08fd0b2cd0444b7ddf0ef9fd7a1a
7988
FirebaseAuth: 75a062bbf2d3c97d1e6e55bbc110e13a6853e25d
8089
FirebaseCore: 5a885548bbc5f0c410b04f8e9ac9d73ff1221907
8190
FirebaseDatabase: 750a4a0fe18ef114318876fd654b2d9c671e0992
@@ -88,8 +97,7 @@ SPEC CHECKSUMS:
8897
GoogleNetworkingUtilities: 3edd3a8161347494f2da60ea0deddc8a472d94cb
8998
GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
9099
GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358
91-
OAuthSwift: 1ef042d4362e755e24a78f158d817245641a5d24
92100

93-
PODFILE CHECKSUM: c252ea2f42ecf6f70437d9183128531900a531b7
101+
PODFILE CHECKSUM: 70422e9e2b45cf788d75fa1c925bae7d8422d819
94102

95103
COCOAPODS: 1.0.1

ios/Pods/Firebase/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)