> For the complete documentation index, see [llms.txt](https://bamtech.gitbook.io/dev-standards/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bamtech.gitbook.io/dev-standards/react-native/features/deep-linking.md).

# deep-linking

## Owner : [Nicolas Ngomai](https://github.com/lechinoix)

* What is deep linking?

Deeplinking permits you to register a custom URL Scheme in your phone so that when calling a url as `myapp://mypath?param=value` the phone will open the app with the `mypath?param=value`. In React Native, you can use the `Linking Module` that handle the external links in your app. When calling a deeplink in your app, a 'url' event will be dispatch with the url associated.

## How to implement?

* Follow this guide from react navigation: <https://reactnavigation.org/docs/guides/linking>
* For complementary information, you can consult Linking documentation : <https://facebook.github.io/react-native/docs/linking.html>

## Troubleshooting

### iOS

If you have Facebook SDK installed, a "application" function will already be implemented in your AppDelegate.m You will need to refactor the two methods as is:

```objectivec
- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

  if([[FBSDKApplicationDelegate sharedInstance] application:application
                                                                openURL:url
                                                      sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                                                             annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
      ]){
    return YES;
  }
  else if([RCTLinkingManager application:application openURL:url options:options]){
    return YES;
  }

  return NO;
}
```

### Android

If you already have an intent-filter in your MainApplication, had a different one just beside

```markup
<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="myapp" android:host="myapp" />
</intent-filter>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bamtech.gitbook.io/dev-standards/react-native/features/deep-linking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
