You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-6Lines changed: 22 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -332,14 +332,30 @@ Add the following code to `AppDelegate.m` (to support iOS 10 and below)
332
332
333
333
#### Integration of the library with a Swift iOS project
334
334
335
-
The approach mentioned above should also be possible to employ with Swift. In this case one should have to import `RNAppAuth`
336
-
and make `AppDelegate` conform to `RNAppAuthAuthorizationFlowManager`. Note that this has not been tested.
337
-
`AppDelegate.swift` should look something like this:
335
+
The approach mentioned should work with Swift. In this case one should make `AppDelegate` conform to `RNAppAuthAuthorizationFlowManager`. Note that this is not tested/guaranteed by the maintainers.
336
+
337
+
Steps:
338
+
339
+
1. `swift-Bridging-Header.h` should include a reference to `#import "RNAppAuthAuthorizationFlowManager.h`, like so:
340
+
341
+
```h
342
+
#import <React/RCTBundleURLProvider.h>
343
+
#import <React/RCTRootView.h>
344
+
#import <React/RCTBridgeDelegate.h>
345
+
#import <React/RCTBridge.h>
346
+
#import "RNAppAuthAuthorizationFlowManager.h" // <-- Add this header
347
+
#if DEBUG
348
+
#import <FlipperKit/FlipperClient.h>
349
+
// etc...
350
+
```
351
+
352
+
2. `AppDelegate.swift` should implement the `RNAppAuthorizationFlowManager` protocol and have a handler for url deep linking. The result should look something like this:
338
353
339
354
```swift
340
-
@import RNAppAuth
341
-
class AppDelegate: UIApplicationDelegate, RNAppAuthAuthorizationFlowManager {
342
-
public weak var authorizationFlowManagerDelegate: RNAppAuthAuthorizationFlowManagerDelegate?
355
+
@UIApplicationMain
356
+
class AppDelegate: UIApplicationDelegate, RNAppAuthAuthorizationFlowManager { //<-- note the additional RNAppAuthAuthorizationFlowManager protocol
357
+
public weak var authorizationFlowManagerDelegate: RNAppAuthAuthorizationFlowManagerDelegate? // <-- this property is required by the protocol
358
+
//"open url" delegate functionfor managing deep linking needs to call the resumeExternalUserAgentFlowWithURL method
0 commit comments