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 99
1010#import < UIKit/UIKit.h>
1111
12- @protocol OIDAuthorizationFlowSession;
13-
1412@interface AppDelegate : UIResponder <UIApplicationDelegate>
15- @property (nonatomic , strong , nullable ) id <OIDAuthorizationFlowSession> currentAuthorizationFlow;
1613@property (nonatomic , strong , nullable ) UIWindow *window;
17-
1814@end
1915
Original file line number Diff line number Diff line change 88 */
99
1010#import " AppDelegate.h"
11-
1211#import < React/RCTBundleURLProvider.h>
1312#import < React/RCTRootView.h>
1413#import < AppAuth/AppAuth.h>
14+ #import < RNAppAuth/RNAppAuthAuthorizationFlowManager.h>
15+
16+ @interface AppDelegate ()<RNAppAuthAuthorizationFlowManager> {
17+ id <OIDAuthorizationFlowSession> _currentSession;
18+ }
19+ @end
1520
1621@implementation AppDelegate
1722
23+ -(void )setCurrentAuthorizationFlowSession : (id <OIDAuthorizationFlowSession>)session {
24+ _currentSession = session;
25+ }
26+
1827- (BOOL )application : (UIApplication *)application didFinishLaunchingWithOptions : (NSDictionary *)launchOptions
1928{
2029 NSURL *jsCodeLocation;
@@ -35,14 +44,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3544 return YES ;
3645}
3746
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;
4651}
4752
4853@end
You can’t perform that action at this time.
0 commit comments