Utilities

🔗 Integrated Deep Links

Creating and using integrated deep links

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 SuperQi Not Installed

If the user does not have SuperQi 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(userAgent)) {
            window.location.replace(config.playStoreUrl);
        } else if (/iPad|iPhone|iPod/.test(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 SuperQi, try the following link on your pc and phone:
https://deeplink.qi.iq/3488010192546203/

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

The trailing backslash is mandatory