FormidableLabs / FormidableLabs/react-native-app-auth
React Native iOS app crashed when used react-native-app-auth
- Lingua principale
- Java
- Stelle
- 2.3k
- Fork
- 473
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Issue
I have installed the react-native-app-auth and done with all three steps that are required for iOS setup:
1. Install native dependencies
2. Register redirect URL scheme
3. Define openURL callback in AppDelegate
## Environment
* **Your Identity Provider**: `Microsoft`
* **Platform that you're experiencing the issue on**: `iOS`
* **Your `react-native` Version**: `0.80.2`
* **Your `react-native-app-auth` Version**: `8.0.3`
* **Are you using Expo?** No
My AppDelegate.swift looks like below:
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
let delegate = ReactNativeDelegate()
let factory = RCTReactNativeFactory(delegate: delegate)
delegate.dependencyProvider = RCTAppDependencyProvider()
reactNativeDelegate = delegate
reactNativeFactory = factory
window = UIWindow(frame: UIScreen.main.bounds)
factory.startReactNative(
withModuleName: "com.myapp",
in: window,
launchOptions: launchOptions
)
return true
}
// Handle OAuth redirect URLs
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// Forward to React Native’s Linking
return RCTLinkingManager.application(app, open: url, options: options)
}
// Handle Universal Links
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
return RCTLinkingManager.application(
application,
continue: userActivity,
restorationHandler: restorationHandler
)
}
}
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
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
}
}
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da AppDelegate.swift e riproduci il crash iOS utilizzando la configurazione segnalata con React Native 0.80.2 e react-native-app-auth 8.0.3, acquisendo l’output del crash. Verifica i punti di ingresso open-url e continue-user-activity dell’applicazione rispetto ai tre passaggi di configurazione iOS elencati. Il lavoro è completato quando l’app si avvia e il reindirizzamento Microsoft OAuth viene completato senza crash.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react-native, swift
- Ambito
- authentication, mobile
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100