Skip to content

Update React Native login guide for AppDelegate setup in Swift and Objective-C++ #10521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions articles/quickstart/native/react-native/00-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,29 @@ At runtime, the `applicationId` value will automatically update with your applic
:::

### Configure iOS

In the file `ios/<YOUR PROJECT>/AppDelegate.mm` add the following:
#### AppDelegate Setup (Choose Based on Architecture)

If You're Using (Swift - `ios/<YOUR PROJECT>/AppDelegat.swift`) update the following:

```swift

class AppDelegate: RCTAppDelegate {
// ... your existing code ...
// update bundleURL method -> add return
override func bundleURL() -> URL? {
#if DEBUG
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
// add the below method
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return Auth0.resumeAuth(url, options: options)
}
}
```
If You're Using (Objective-C++ - `ios/<YOUR PROJECT>/AppDelegate.mm`) add the following:

```objc
#import <React/RCTLinkingManager.h>
Expand Down