Peakiq Blog
20 December 2025

AppDelegate.swiftFirst, modify your AppDelegate.swift file to handle deep linking.
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 = "peakiq"
self.dependencyProvider = RCTAppDependencyProvider()
self.initialProps = [:]
return super.application(application, didFinishLaunchingWithOptions: launchOptions)}
override func sourceURL(for bridge: RCTBridge) -> URL? {
return self.bundleURL()
}
override func bundleURL() -> URL? {
#if DEBUG
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
// Handle URL Schemes (e.g., peakiq://)
override func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return RCTLinkingManager.application(app, open: url, options: options)
}
// Handle Universal Links (e.g., https://peakiq.in)
override func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
if let url = userActivity.webpageURL {
return RCTLinkingManager.application(application, open: url, options: [:])
}
return false
}
}
Info.plistOpen ios/peakiq/Info.plist and add the following:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>peakiq</string> <!-- Your custom scheme -->
</array>
</dict>
</array><key>LSApplicationQueriesSchemes</key>
<array>
<string>peakiq</string>
<string>https</string>
</array>
This allows iOS to recognize peakiq:// as a valid deep link scheme.
Modify App.tsx to define linking behavior.
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';const Stack = createStackNavigator();
const linking = {
prefixes: ['peakiq://', 'https://peakiq.in'],
config: {
screens: {
Home: 'home',
Profile: 'profile/:id',
},
},
};
const App = () => {
return (
<NavigationContainer linking={linking}>
<Stack.Navigator>
<Stack.Screen name="Home" component={() => <></>} />
<Stack.Screen name="Profile" component={() => <></>} />
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;
Run these commands to test deep linking:
xcrun simctl openurl booted peakiq://home
xcrun simctl openurl booted peakiq://profile/123Open Safari on the simulator.
Enter peakiq://profile/123 and press Go.
Your app should open and navigate to the Profile screen.
To test deep linking within your app, add a button:
import { Linking, Button } from 'react-native';const testDeepLinking = () => {
Linking.openURL('peakiq://profile/123');
};
<Button title="Test Deep Link" onPress={testDeepLinking} />;
You’ve successfully configured deep linking in your React Native app usingAppDelegate.swift 🚀
Now,
👉 peakiq://profile/123 will navigate directly to the Profile screen.
If you plan to support universal links (https://peakiq.in), you’ll also need to configure Apple Associated Domains and host the apple-app-site-association file.