---
title: "Deeplinks"
slug: "mobile-deeplinks"
updated: 2026-06-09T22:54:53Z
published: 2026-06-09T22:54:53Z
canonical: "docs.xtremepush.com/mobile-deeplinks"
stale: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deeplinks

Deeplinks are a type of link that sends users directly to a specific section of an app when they open a notification.

This can be achieved in 3 ways, using:

- Standard deeplinks
- A URL scheme
- Custom message payloads

## Standard deeplinks

Xtremepush has a callback for deeplink strings sent from the platform that include the **Go to Deeplink** action.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/d41c286-Screen_Shot_2017-09-26_at_14.57.42(1).png)

### iOS

Here is how you register the handler in the `didFinishLaunchingWithOptions` method in the AppDelegate:

**Swift**

```swift
XPush.registerDeeplinkHandler({(_ x: String) -> Void in
        })
```

**Objective-C**

```objectivec
[XPush registerDeeplinkHandler:^(NSString *x) {
        NSLog(@"[AppDelegate] - DeeplinkHandler: %@", x);
    }];
```

Below is a simple example of how this can be used

**Swift**

```swift
XPush.registerDeeplinkHandler({(_ x: String) -> Void in
        switch x{
            case "checkout":
                self.goToCheckout()
            case "offers":
                self.goToOffers()
            default:
                print("unrecognised deeplink")
        }
    })
```

**Objective-C**

```objectivec
[XPush registerDeeplinkHandler:^(NSString *x) {
        if ([x isEqualToString:@"checkout"])
        {
            [self goToCheckout];
        }
        else if([x isEqualToString:@"offers"])
        { 
            [self goToOffers];
        }
    }];
```

### Android

First, you must implement the `DeeplinkListener` interface in your `Application.java` class.

```java
public class YOUR_APPLICATION_CLASS extends Application implements DeeplinkListener {
```

Then you must implement the callback.

```java
@Override
    public void deeplinkReceived(String link, WeakReference uiReference) {
    }
```

Below is a simple example of how this can be used:

```java
@Override
    public void deeplinkReceived(String link, WeakReference uiReference) {
        switch (link){
            case "checkout":
                goToCheckout();
                break;
            case "offers":
                goToOffers();
                break;
        }
    }
```

Don't forget to add the `DeeplinkListener` object you created to `PushConnector.builder`:

```java
new PushConnector.Builder(XPUSH_APP_KEY, GOOGLE_PROJECT_NUMBER)
 ...
 .setDeeplinkListener(this)
 .create(this);
```

## URL scheme

If you are using HTTPS links or a custom URL scheme in your app you can use the **Open URL** action on the platform.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/e07909d-Screen_Shot_2017-09-26_at_15.46.32(1).png)

For iOS, more information on implementing a URL-based deeplinks can be found [here](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content).

For Android, more information on implementing URL-based deeplinks can be found [here](https://developer.android.com/training/app-links/deep-linking).

## Custom payloads

Custom payloads can also be used to navigate a user to specific pages of your app.

![](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/1ef98df-Screen_Shot_2017-09-26_at_15.53.14(1).png)

**Java**

```java
@Override
    public void messageResponseReceived(final Message messagePayload,
                                        HashMap<String, String> responsePayload,
                                        final WeakReference uiReference) {
        if (responsePayload.get("type").equals("click")) {
            if (messagePayload.data.containsKey("article")) {
                openArticle(messagePayload.data.get("article"));
            }
        }
    }
```

**Swift**

```swift
XPush.registerMessageResponseHandler({(_ response: XPMessageResponse) -> Void in
        if response.action.type == XPActionType_Click {
            if (x.message.data?["article"] != nil) {
                self.openArticle(x.message.data!["article"] as! String);
            }
        }
    })
```

**Objective-C**

```objectivec
[XPush registerMessageResponseHandlerWithCompletion:^(XPMessageResponse * _Nonnull 
    switch (response.action.type) {
        case XPActionType_Click:
            if (response.message.data[@"article"]){
                [self openArticle: response.message.data[@"articleId"]];
            }
            break;
    }
     completionHandler();
}];
```

> [!NOTE]
> Custom handling of messages
> 
> Information on implementing the MessageResponseHandlers can be found [here](/documentation/docs/mobile-message-custom-handling).
