FormidableLabs / FormidableLabs/react-native-app-auth
Instructions for react native 0.77 and 0.78
- Vorherrschende Sprache
- Java
- Sterne
- 2.3k
- Forks
- 473
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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?
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react-native, swift
- Bereich
- documentation, mobile
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100