File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
Example/ios/AppAuthExample Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 9
9
10
10
#import < UIKit/UIKit.h>
11
11
12
- @protocol OIDAuthorizationFlowSession;
13
-
14
12
@interface AppDelegate : UIResponder <UIApplicationDelegate>
15
- @property (nonatomic , strong , nullable ) id <OIDAuthorizationFlowSession> currentAuthorizationFlow;
16
13
@property (nonatomic , strong , nullable ) UIWindow *window;
17
-
18
14
@end
19
15
Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
#import " AppDelegate.h"
11
-
12
11
#import < React/RCTBundleURLProvider.h>
13
12
#import < React/RCTRootView.h>
14
13
#import < AppAuth/AppAuth.h>
14
+ #import < RNAppAuth/RNAppAuthAuthorizationFlowManager.h>
15
+
16
+ @interface AppDelegate ()<RNAppAuthAuthorizationFlowManager> {
17
+ id <OIDAuthorizationFlowSession> _currentSession;
18
+ }
19
+ @end
15
20
16
21
@implementation AppDelegate
17
22
23
+ -(void )setCurrentAuthorizationFlowSession : (id <OIDAuthorizationFlowSession>)session {
24
+ _currentSession = session;
25
+ }
26
+
18
27
- (BOOL )application : (UIApplication *)application didFinishLaunchingWithOptions : (NSDictionary *)launchOptions
19
28
{
20
29
NSURL *jsCodeLocation;
@@ -35,14 +44,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
35
44
return YES ;
36
45
}
37
46
38
- - (BOOL )application : (UIApplication *)app
39
- openURL : (NSURL *)url
40
- options : (NSDictionary <NSString *, id> *)options {
41
- if ([_currentAuthorizationFlow resumeAuthorizationFlowWithURL: url]) {
42
- _currentAuthorizationFlow = nil ;
43
- return YES ;
44
- }
45
- return NO ;
47
+ - (BOOL )application : (UIApplication *)app openURL : (NSURL *)url options : (NSDictionary <NSString *, id> *)options {
48
+ BOOL shouldOpenUrl = [_currentSession resumeAuthorizationFlowWithURL: url];
49
+ _currentSession = nil ;
50
+ return shouldOpenUrl;
46
51
}
47
52
48
53
@end
You can’t perform that action at this time.
0 commit comments