Deep Linking in IFS FSM

IFS FSM Deep link – Launch Teams, WhatsApp, and other native mobile apps from the IFS FSM mobile app

As part of IFS FSM Update 15, we received the much-awaited feature to be able to deep link into other mobile applications from within the IFS FSM mobile app.  

In this article we will deep dive into its details, a demonstration of the functionality, how to set it up and some future ideas on how this could be used in other use cases  

What is deeplink? 

In the simplest interpretation, a deep link is any link that directs a user past the home page of a website or app to content inside of it. e.g., linking directly to a product instead of the home page. Deep links are a way to identify, address and transport users to specific content in apps. 

Deep linking revolves around URLs, or URIs (Uniform Resource Identifier), which is a string of characters used to identify the name of a resource on a network – an address. Apps installed on a device can directly open via a unique registered scheme called a “URI Scheme”. 

There are several options to enable deep linking, such as: 

  • URI Scheme: URI, or Universal Resource Identifier, is the legacy deep linking method in which requires to registers a “scheme” for the app. If the app is already installed on the device, it is opened, and the link is parsed to direct the user to the desired page. URI schemes do not work if the app is not already installed, it will result in an error. 

  • Universal Links: Universal Links are an improvement on URI schemes that allows users to navigate to specific content even if the app is not already installed. If the app is not installed, the user is first taken to the verified web domain, and then to a specific page after installation. 

Let take a look at a demonstration to launch MS Teams App and WhatsApp App from the IFS FSM mobile app

How it Works

As part of update 15 a new Mobile client script function launchURI is now available to be used. We have a sample client script available as part of the upgrade package under the FSM Client Scripts with the script id “TMP_CHAT_LINK”. This example script uses the universal links method to launch the teams app on the mobile device.

Breaking down the script we can figure out its usage 

//Line 1 – Here we define a variable and populate that with the data from a particular field off the person table 

var voipUserName = getControlValue("person","voip_user_name"); 

//Line 2 – We perform a null or empty string check to stop proceeding if the field is empty 
if (isNullOrEmptyString(voipUserName) == false) { 

//Line 3 – This is the key part of the script where we construct the universal link that the MS team app expects. 
    var url = "https://teams.microsoft.com/l/chat/0/0?users=" + voipUserName; 

//Line 4 –Finally we use the new launchURL function and pass the link that we created in step 3 
    launchURI(url); 

This “TMP_CHAT_LINK” script is then defined on the mobile screen (see image below) which is called on the tap event of the hyper link 

How to Set it up to launch WhatsApp 

Now let’s extend the same to be able to launch WhatsApp to text the team member.  

To launch WhatsApp via deep link we navigate to the help document of WhatsApp to know the format of the universal link. Note – WhatsApp can also be launched via the URI Scheme capability which we will talk about in another article. 

https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=en  

From the FAQ we see that to launch WhatsApp we need to pass the mobile number in international format without any symbols.  

Data Setup 

In order to store this number, we will reuse the pager field already available on the person record to repurpose it to store and launch the WhatsApp number. 

Mobile Client Script setup  

We will create a new client script to launch WhatsApp using the number from the pager field 

Client script code used is as below

var wsappNumber = getControlValue("person","pager");
if (isNullOrEmptyString(wsappNumber) == false) {
    var url = "https://wa.me/" + wsappNumber;
    launchURI(url);
}

Mobile sync rule setup 

Let’s verify if the person sync rule sends the pager field over to the mobile device or not.  

To do this we check the Initial Query value for the attributes. If the person.pager attribute is not part of the xml we will add it.


Message Translation setup 

Let’s create a few message translations for the WhatsApp label. We will create a translation for Client, Description and Label for the English (US) locale code 

Mobile Screen setup  

  • Let’s create a new revision of the Field Service Design 

  • On the new revision navigate to screens and then TeamMemberProfile screen 

  • Click on View Fields to add a new field to the form

  • On the TeamMemberProfile fields screen, click “add field”

  • Lets add the pager field on the form

  • After adding the field lets edit the field properties of this pager field

  • We will update the following

    • Control Type – Hyperlink 

    • Control Event – TMP_WHATSAPP_CHAT (script of the ID created in step 2) 

    • Label – WhatsApp (select the message translation created in step 4)

Now that all the setup is complete, we can publish the revision activate it and verify the team member screen to launch WhatsApp on the defined number. 

 

OTHER POTENTIAL USE CASES 

Opening MS teams app or the WhatsApp app by passing contextual parameters from the FSM Mobile is just one of the many use cases that is now made possible with update 15. Other possibilities include 

  • Opening 3rd party apps to capture specific surveys 

  • Opening 3rd party apps to perform online functions 

  • Opening MS power app 

  • Opening the weather app by passing latitude / longitude details from the task to know the weather condition of the area where the job needs to be performed. 

Previous
Previous

The Multi Tiers of PSO Architecture

Next
Next

How Does ARP Work