Issue with Deep Links and Universal Links in Mobile App

bineetchaubey
ServiceNow Employee
ServiceNow Employee

Hi Team,

 

I’m encountering some issues with deep linking and universal linking in my mobile application and would appreciate any assistance.

 

Here’s a brief overview of the problem:

  1. When the app is installed on the mobile device:
    • The deep link works correctly.
    • The universal link, however, is not functioning as expected. It’s returning an error indicating that the Error Loading URL.
  2. When the app is not installed on the mobile device:
    • The universal link leads to a page showing the error: "Page not found. Sorry, the page you are looking for could not be found."

 

bineetchaubey_0-1722924229407.png

 

Details:

  • The deepLink generated works when the app is installed.
  • The uniLink does not seem to be valid, resulting in errors.
  • When the app is not installed, the universal link directs to a "Page not found" error in the browser.

 

 

What I’ve checked:

  • The deep link URL format appears correct and works as expected.
  • The universal link should theoretically resolve to the correct page, but it's either invalid or not properly set up.

Has anyone experienced similar issues or have any suggestions for troubleshooting or resolving this problem? Any advice on how to properly configure or debug the universal link would be greatly appreciated.

 

Following is script snippet for generating universal  link 

var screenSysId = '';
var screen = new GlideRecordSecure("sys_sg_form_screen");
screen.addQuery("name", "Workday Time Off Request");
screen.query();

if (screen.next()) {
    screenSysId = screen.sys_id.toString();
}

gs.info('screenSysId: ' + screenSysId);

var recordSysId = '1ef4c4201be30610096c21b0604bcbaa';
var tableName = 'x_snc_uni_inbox_universal_box_external_workday_approvals';

var deepLinkGen = new global.MobileDeepLinkGenerator('Request');
var deepLink = deepLinkGen.getFormScreenLink(screenSysId, tableName, recordSysId);
gs.info('deepLink: ' + deepLink);

var uniLink = deepLinkGen.getUniversalLink(deepLink);
gs.info('uniLink: ' + uniLink);

Thanks.

8 REPLIES 8

bineetchaubey
ServiceNow Employee
ServiceNow Employee

 

I have also marked the checkbox enable as suggested by the documentation to redirect the user to the app store if the app is not installed in mobile.

bineetchaubey_0-1723019020452.png

But even after that the deeplink is not working. Whereas it should redirect to the app store if the app is not installed in the mobile.

sp32
Tera Expert

@bineetchaubey  Were you able to fix this issue. I am having the similar requirement to redirect to App store if app is not installed. Struggling to get the universal link working.  Thank you!

bineetchaubey
ServiceNow Employee
ServiceNow Employee

Hi @sp32,  Yes, it is working with xanadu, deeplink is sufficient to redirect user to app store if app is not installed on mobile. 

Thank you. I tested in my personal instance and its working now in Xanadu