FormidableLabs / FormidableLabs/react-native-app-auth
Instructions for react native 0.77 and 0.78
- Lingua principale
- Java
- Stelle
- 2.3k
- Fork
- 473
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Documentation Feedback
I'm struggling to configure the lib for iOS, since the version of my project is 0.78, which AppDelegate.swift syntax is a little different from the expected in de documentation.
In example, a fresh project has this file: (got this info from [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/?from=0.75.3&to=0.78.3))
```swift
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
@main
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.moduleName = "RnDiffApp"
self.dependencyProvider = RCTAppDependencyProvider()
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = [:]
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}
````
And the docs says that for react-native >= 0.77, this is expected:
```swift
@main
**class AppDelegate: UIResponder, UIApplicationDelegate,
RNAppAuthAuthorizationFlowManager** {
//... existing code...
// Required by RNAppAuthAuthorizationFlowManager protocol
public weak var authorizationFlowManagerDelegate:
RNAppAuthAuthorizationFlowManagerDelegate?
//... existing code...
// Handle OAuth redirect URL
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
if let authorizationFlowManagerDelegate = self
.authorizationFlowManagerDelegate
{
if authorizationFlowManagerDelegate.resumeExternalUserAgentFlow(with: url)
{
return true
}
}
return false
}
}
```
Which is an update in AppDelegate.swift that took place in react native 0.79.0.
How should this be properly configured?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by comparing the documentation's AppDelegate.swift example with the React Native 0.77 and 0.78 AppDelegate.swift shown in the issue, then verify the React Native 0.79.0 change referenced by the reporter. Update the version-specific instructions so the supported configuration is explicit and confirm that both documented flows are internally consistent.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react-native, swift
- Ambito
- documentation, mobile
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100