Mobile App URL Scheme in Survey123 not working

1949
7
Jump to solution
06-15-2017 09:28 AM
RenatoSalvaleon
Occasional Contributor III

Following the Trek2There app as a sample I'm trying to create a Launch hyperlink in my survey123 using a mobile app called Foreflight.

This is the URL schemes of the two apps next to each other.

Mobile app

mobile URL Scheme (both works in i)

Calculation field of survey
ETrek2There

arcgis-trek2there://?stop=38.133453,-117.223455

concat('<a href="arcgis-trek2there://?stop=',${Lat},',',${Lon},'">Launch Smart Compass</a>')

Foreflight

foreflightmobile://maps/search?q=36.01N/75.67W

concat('<a href="foreflightmobile://maps/search?q=',${latitude},’,’,${longitude},’">Launch Foreflight</a>')

For Foreflight, I purposely removed the characters "N/" & "W" to match it with theTrek2There sample and see if it would work.

I get the error message below.

Survey1213 Error message

It seems like my <a href >statement is not being parsed correctly. I hope someone with sharper eyes can see what's wrong. I'm also curious what to do with the character "N/" when I add it back. I'm afraid that the forward slash character will also cause an issue.

Any help would be appreciated.

ichivite-esristaff‌ any suggestions.

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi salvaleonrp‌  Looking at the syntax of your calculation I noticed that the single quotes were not 'straight'. This explains the validator errors. After replacing the single quotes I was able to get your expression to validate:

concat('<a href="foreflightmobile://maps/search?q=',${Lat},',',${Lon},'">Launch Foreflight</a>')

I installed ForeFlight and tried the link to realize that the link in my iPhone was not launching (as you described). Other links using an http resource work well, so I am afraid this may be an operating system behavior. I wonder if recent updates to iOS are now blocking deep links to other apps.    I will research a bit more.

View solution in original post

7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Renato, 

It looks like the form validator is using the / symbol in the concat statement as an escape character- a signal to switch to a special handling based on the next character.  Can you try using // for every / symbol (this will cancel the special handling) and see if it passes validation?  You might then have to do manually tweak a file- but first let's see if that works.

0 Kudos
RenatoSalvaleon
Occasional Contributor III

I tried that but it did not work either. I change the curly bracket to paren and the validation came out okay but the link came out as text.  I tried a different approach. Please see attached.

Everything looks okay until I test it on the device. Looks exactly like that but the link does not launch. I tried double tap, single tap, press and hold but it stays as colored underlined text.

So how do I manually tweak a file? from the survey's sub folders? what are the pros and cons of doing this?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Renato,

Altering and updating the form manually is possible, but is a fairly advanced workflow.

The file that would need to be tweaked is the <survey name>.xml file.  For this particular tweak (altering the text in the node), it should be possible to do this with minimal risk of breaking the form.  After that, you would need to update the survey:

1) Place all survey files into a director named 'esriinfo'.  Zip the esriinfo directory up and make the name of the zip file the same as the survey

2) Update the zip file.  This is best done using a program like Postman, which is designed to help you manually construct requests that otherwise are automated.

  • You'll want to get a token from ArcGIS first.  This can be done by using the developer's tools in your browser to get you token from the Esri login cookie or be requesting one directly:
  • The URL for updating an item is https://www.arcgis.com/sharing/rest/content/<username>/<folderID>/items/<itemID>/update
    See ArcGIS REST API  for reference.  
0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi salvaleonrp‌  Looking at the syntax of your calculation I noticed that the single quotes were not 'straight'. This explains the validator errors. After replacing the single quotes I was able to get your expression to validate:

concat('<a href="foreflightmobile://maps/search?q=',${Lat},',',${Lon},'">Launch Foreflight</a>')

I installed ForeFlight and tried the link to realize that the link in my iPhone was not launching (as you described). Other links using an http resource work well, so I am afraid this may be an operating system behavior. I wonder if recent updates to iOS are now blocking deep links to other apps.    I will research a bit more.

RenatoSalvaleon
Occasional Contributor III

I  confirm that S123 2.4 works for Foreflight. Thanks!

0 Kudos
RenatoSalvaleon
Occasional Contributor III

On a new iPhone8, it looks like it’s broken again. Link will not launch Foreflight anymore. On my iPad with iOS10 it still works.

0 Kudos
by Anonymous User
Not applicable

Hi Renato,

I have just tested a survey in 2.4.72 with the above custom URL to launch ForeFlight on an iPhone 8 with iOS11, and it launches the ForeFlight app correctly. Also tested the same survey on an iPhone 7 iOS 11, iPad Mini iOS 11, iPad Pro with iOS 10.3 and all working as expected.

Can you confirm what version of the Survey123 app and ForeFlight app you have installed?

Regards,

Phil.

0 Kudos