Utilities

Deep Links

Complete guide to creating and integrating deep links in Super Qi

Deep links allow you to directly navigate users to specific content within the Super Qi app. This guide covers the deep link format specification and how to integrate them into your systems.

The deep link general structure is as follows:

qicardwallet://qicard/deeplink.htm?action=<action-name>&<action parameters>

For opening H5+ Miniapps and passing data to them, use the following structure:

qicardwallet://qicard/deeplink.htm?action=miniapp&miniappId=[0]&_griver_appended_url_part=[1]
Fields explanation
  1. Use the Miniapp ID, obtained from the Miniapps console.
  2. This part consists of the URL path, query string and fragment

Integration & Usage

As this is a URI and not a URL (What's the difference?), we can't share it with users directly. However, we can use another approach where we direct the user to the Deep Link URI from a custom web page.

Sample JavaScript Code

The whole idea is to redirect the user visiting our web page to the Deep Link URI using this simple snippet:

const url = `qicardwallet://qicard/deeplink.htm?action=miniapp&miniappId=${appID}&_griver_appended_url_part=${pathAndQuery}`

window.onload = () => {
  window.location.replace(url);
}

Advanced Handling

We always strive for better user experience. Since the link would be publicly accessible, we can take a couple of extra steps to enhance the user's interaction with our system.

Users With Super Qi Not Installed

If the user does not have Super Qi installed, then the window.location.replace will not work, so we can introduce a delay to redirect the user to the store page for their respective platform:

const url = `qicardwallet://qicard/deeplink.htm?action=miniapp&miniappId=${appID}&_griver_appended_url_part=${pathAndQuery}`

const config = {
    timeout: 5 * 1000,
    appStoreUrl: "https://apps.apple.com/app/id1450079855",
    playStoreUrl: "https://play.google.com/store/apps/details?id=iq.qicard.qipay.prod"
}

window.onload = () => {
    window.location.replace(url);

    setTimeout(() => {
        if (/android/i.test(navigator.userAgent)) {
            window.location.replace(config.playStoreUrl);
        } else if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
            window.location.replace(config.appStoreUrl);
        }
    }, config.timeout);
}
If a user is opening the page from PC, we can redirect them to a page with a QR code they can scan to take them to the first page

Ready Implementation

You can use our own standard implementation for supporting deep links: https://deeplink.qi.iq

Usage Example

https://deeplink.qi.iq/[0]/[1]
  1. Your Miniapp ID obtained from the Miniapps console
  2. Your path and query params

Working Examples

If you have the UAT build of Super Qi, try the following link on your pc and phone:
https://deeplink.qi.iq/3488010192546203/

If you're running the store version of Super Qi then open this link:
https://deeplink.qi.iq/3488020185653655/

The trailing forward slash (/) is mandatory