Skip to content

Commit a27ab75

Browse files
Update iOS configuration instructions for React Native login tutorial to include AppDelegate setup for Swift and Objective-C++ (#10527)
1 parent b40aee8 commit a27ab75

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

articles/quickstart/native/react-native/interactive.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ pod install
6969

7070
</code></pre>
7171

72-
</p><p><div class="alert-container" severity="default"><p>At runtime, the <code>applicationId</code> value will automatically update with your application&#39;s package name or ID (e.g. <code>com.example.app</code>). You can change this value from the <code>build.gradle</code> file. You can also check it at the top of your <code>AndroidManifest.xml</code> file.</p></div></p><h3>Configure iOS</h3><p>In the file <code>ios/&lt;YOUR PROJECT&gt;/AppDelegate.mm</code>, add the following:</p><p><pre><code>#import &lt;React/RCTLinkingManager.h&gt;
72+
</p><p><div class="alert-container" severity="default"><p>At runtime, the <code>applicationId</code> value will automatically update with your application&#39;s package name or ID (e.g. <code>com.example.app</code>). You can change this value from the <code>build.gradle</code> file. You can also check it at the top of your <code>AndroidManifest.xml</code> file.</p></div></p>
73+
<h3>Configure iOS</h3><h4>AppDelegate Setup (Choose Based on Architecture)</h4><p>If you're using (Swift - <code>ios/&lt;YOUR PROJECT&gt;/AppDelegat.swift</code>) add the following in `AppDelegate` class:</p><p><pre><code>func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -&gt Bool {
74+
return RCTLinkingManager.application(app, open: url, options: options)
75+
}</code></pre></p>
76+
<p>If you're using (Objective-C++ - <code>ios/&lt;YOUR PROJECT&gt;/AppDelegate.mm</code>) add the following:</p><p><pre><code>#import &lt;React/RCTLinkingManager.h&gt;
7377

7478

7579

fr-ca/articles/quickstart/native/react-native/00-login.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ At runtime, the `applicationId` value will automatically update with your applic
8484
:::
8585

8686
### Configure iOS
87+
#### AppDelegate Setup (Choose Based on Architecture)
8788

88-
In the file `ios/<YOUR PROJECT>/AppDelegate.mm` add the following:
89+
If you're using (Swift - `ios/<YOUR PROJECT>/AppDelegat.swift`) add the following in `AppDelegate` class:
90+
91+
```swift
92+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
93+
return RCTLinkingManager.application(app, open: url, options: options)
94+
}
95+
```
96+
If you're using (Objective-C++ - `ios/<YOUR PROJECT>/AppDelegate.mm`) add the following:
8997

9098
```objc
9199
#import <React/RCTLinkingManager.h>

ja-jp/articles/quickstart/native/react-native/00-login.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ At runtime, the `applicationId` value will automatically update with your applic
8484
:::
8585

8686
### Configure iOS
87+
#### AppDelegate Setup (Choose Based on Architecture)
8788

88-
In the file `ios/<YOUR PROJECT>/AppDelegate.mm` add the following:
89+
If you're using (Swift - `ios/<YOUR PROJECT>/AppDelegat.swift`) add the following in `AppDelegate` class:
90+
91+
```swift
92+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
93+
return RCTLinkingManager.application(app, open: url, options: options)
94+
}
95+
```
96+
If you're using (Objective-C++ - `ios/<YOUR PROJECT>/AppDelegate.mm`) add the following:
8997

9098
```objc
9199
#import <React/RCTLinkingManager.h>

0 commit comments

Comments
 (0)